Fixed
Status Update
Comments
je...@google.com <je...@google.com>
im...@google.com <im...@google.com> #2
Hi there,
The namespaced R classes flag is only for R classes in libraries, that's why you didn't see it affect the R.java in the app module.
Could you give the AGP 3.6 a try?
The namespaced R classes flag is only for R classes in libraries, that's why you didn't see it affect the R.java in the app module.
Could you give the AGP 3.6 a try?
do...@traveloka.com <do...@traveloka.com> #3
I see, so it only affecting android library.
Yes i did tried with 3.6 and it still causing the error. Seems the R$id is to huge in one method, similar tohttps://issuetracker.google.com/issues/142110304
Yes i did tried with 3.6 and it still causing the error. Seems the R$id is to huge in one method, similar to
im...@google.com <im...@google.com> #4
Fixed in Change-Id: I329a74975df14481efb53e5e05e51d1172de4358 which should be included in one of the 4.2 alphas. You will be able to make the R class in the app module non-transitive as well if you use both "android.nonTransitiveRClass" (previously named "android.namespacedRClass") and "android.experimental.nonTransitiveAppRClass" set to true.
Description
Gradle version: 5.6.4 to 6.1.0-milestone-1
AGP: 3.5.2 to 4.0.0-alpha05
I created large android project using:
50 android library modules: 500 activity, 500 layout and 500 image on each module
App module depend on that 50 library modules.
It is failed because R class to large on $id method.
> Task :androidAppModule0:compileFlavDebugJavaWithJavac
/Users/doni.winata/gradle-sample/build-perf-test/androidAppModule0/build/generated/not_namespaced_r_class_sources/flavDebug/r/com/androidAppModule0/R.java:27940: error: too many constants
public static final class id {
^
1 error
Then i tried to enable:
android.namespacedRClass=true
on gradle.properties but the result still the same.
The sample project may too large, but our real project having like 13k of R$id now. wondering if R$id have a limit ? does android.namespacedRClass=true working as expected in this case ? i guess it should not merging R from another module.