Repository navigation
Build with non-final resource ids - #96
Merged
Merged
Conversation
jgindin
force-pushed
the
agp-non-final-res-ids
branch
from
November 26, 2026 19:38
8613c42 to
f3b398f
Compare
jgindin
force-pushed
the
agp-new-dsl
branch
2 times, most recently
from
November 26, 2026 19:56
a86616a to
ae6f143
Compare
jgindin
force-pushed
the
agp-non-final-res-ids
branch
from
November 26, 2026 19:56
f3b398f to
3c9dcbd
Compare
jgindin
force-pushed
the
agp-non-final-res-ids
branch
from
November 26, 2026 20:09
3c9dcbd to
acb87f0
Compare
…ead of switching on them. A switch needs constant case labels, and with AGP's non-final resource ids the ids are not constants. The three switches in ZmanimActivity and the one in ZehutYosefActivity become if/else chains with the same outcomes; the privacy, about and help ids are checked in one place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…releaseCheck builds. With non-final resource ids the tests read the app's R fields at run time, but R8 inlines the ids into the app's own code and drops the R classes, which the test APK shares with the app, so the tests could not find R$id or R$string. The rules keep only the fields the tests read, each naming a resource the app itself uses, so the minified build keeps no resource the release build leaves out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ResIds=false and android.enableAppCompileTimeRClass=false. AGP warns that both options go away in AGP 10. With them gone, the app modules compile against a compile-time R class whose ids are not constants, as library modules do; no code switches on a resource id any more. In the release APKs only the dex files and baseline profiles change, by a few bytes; every resource is the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jgindin
force-pushed
the
agp-non-final-res-ids
branch
from
November 26, 2026 20:21
acb87f0 to
f2d3d0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds both apps with non-final resource ids by removing
android.nonFinalResIds=falseandandroid.enableAppCompileTimeRClass=false, which AGP 9 deprecates and AGP 10 removes.switchstatements on resource ids becomeif/elsechains with the same outcomes. These are three inZmanimActivity(menu items, then creating and preparing the message dialogs) and one inZehutYosefActivity(drawer items). Acaselabel must be a constant, and non-final ids aren't.ZmanimActivitychecks the privacy, about and help ids in one place.Rfields its on-device tests look up. With non-final ids the tests read those fields at run time, but R8 inlines the ids into the app's own code and drops theRclasses that thereleaseChecktest APK shares with the app. Each kept field names a resource the app already uses, soreleaseCheckkeeps no resource that the release build leaves out.In the release APKs only the dex files and baseline profiles change, by a few bytes. Every resource is the same.
On an API 36 emulator, all
releaseCheckon-device tests pass: Zmanim's 15, its offline-naming test with the network off, and 4 per Zehut Yosef flavor.🤖 Generated with Claude Code