Skip to content

Commit b05742a

Browse files
committed
build: remove deprecated enableJetifier and nonTransitiveRClass flags
Both are deprecated and will be removed in AGP 10. enableJetifier rewrites old com.android.support artifacts to AndroidX. The dependency graph contains none, so it was pure build overhead. nonTransitiveRClass=false made app.intra.R re-export every resource from every dependency. Turning it off (the modern default) shrinks the R class and makes resource ownership explicit. Only one reference needed updating: "up" and "home" in the drawer navigation handler are declared by AppCompat rather than by this app, so they are now qualified as androidx.appcompat.R.id. The drawer_menu.xml reference to @id/home is unaffected, since non-transitive R changes only the generated Java R classes, not XML resource resolution. ./gradlew clean assembleDebug test passes; lint reports the same five pre-existing errors as before.
1 parent fe7622f commit b05742a

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

‎Android/app/src/main/java/app/intra/ui/MainActivity.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ public boolean onNavigationItemSelected(MenuItem item) {
210210
// Resource IDs are not compile-time constants, so they cannot be used
211211
// as switch labels.
212212
final int itemId = item.getItemId();
213-
if (itemId == R.id.up || itemId == R.id.home) {
213+
// "up" and "home" are declared by AppCompat, not by this app, so with
214+
// non-transitive R classes they are not part of app.intra.R.
215+
if (itemId == androidx.appcompat.R.id.up || itemId == androidx.appcompat.R.id.home) {
214216
chooseView(R.id.frame_main);
215217
return true;
216218
} else if (itemId == R.id.settings) {

‎Android/gradle.properties‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,8 @@ org.gradle.jvmargs=-Xmx2048m
1919
# This option should only be used with decoupled projects. More details, visit
2020
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
2121
# org.gradle.parallel=true
22-
android.enableJetifier=true
2322
android.useAndroidX=true
2423

25-
# Keep legacy AGP behavior after upgrading to AGP 8.
26-
# TODO: nonTransitiveRClass is deprecated and will be removed in AGP 10.
27-
# Migrating off it requires auditing every R class reference, so it is left
28-
# for a separate change.
29-
android.nonTransitiveRClass=false
30-
3124
ANDROID_COMPILE_SDK_VERSION=36
3225
ANDROID_BUILD_TOOLS_VERSION=36.0.0
3326

0 commit comments

Comments
 (0)