Status Update
Comments
jl...@google.com <jl...@google.com>
to...@gmail.com <to...@gmail.com> #2
be...@google.com <be...@google.com> #3
be...@google.com <be...@google.com> #4
to...@gmail.com <to...@gmail.com> #5
je...@google.com <je...@google.com> #6
Android Studio version: 0.8.12
buildToolsVersion 21.0.1
Gradle 1.11
to...@gmail.com <to...@gmail.com> #7
--set-max-idx-number=<value>
Unfortunately changing the default is not a solution since the linearAlloc limit can be reached at very different levels depending on the classes hierarchy and other criteria.
In addition for most applications, moving to multidex will only help to workaround the linearalloc limit for the installation. But the application will still crash against the same limit at execution. The only working use case where I know multidex can help with linearalloc is when the apk does not contains one application but distinct pieces running in separate process.
to...@gmail.com <to...@gmail.com> #8
It's nice to know about that command line option. I do not see it in the output of 'dx --help', might be good to add that.
I'm not very familiar with the 'linearAlloc limit' issue outside of the context of the dexopt step. My sample app is able to run once the lower idx value is set, although I do not actually call into any of the library code that is bundled with the app. I assume it's undefined when/if the 'linearAlloc limit' will be hit in a large application on gb.
I'm a bit confused as to the platform compatibility of multidex given the 'linearAlloc limit' bug. What specific versions of Android are supported? The multidex code implies back to v4 (
da...@gmail.com <da...@gmail.com> #9
The linearalloc limit is reached when loading classes. At install time dexopt is loading all classes contained in the dex so it's facing the limit immediately. At execution the limit may be reached after some delay dependending of the usage you have of the packaged classes. If you face it at install time but not at execution, this means you never trigger the loading of some classes. In a real application those never loaded classes should have been shrinked away manually or by Proguard. The exception is when there are different groups of classes in the dex files used in separate process.
About multidex library supported versions I've merged recently a change to try to be clearer
The summary is that the library should work down to API 4 (Donut), but below ICS applications will probably be hit by the linearalloc limit
da...@gmail.com <da...@gmail.com> #10
dexOptions {
additionalParameters = ['--multi-dex', '--set-max-idx-number=40000']
}
to...@gmail.com <to...@gmail.com> #11
sp...@google.com <sp...@google.com>
to...@gmail.com <to...@gmail.com> #14
Is there any logs I can provide from the build to help figure out?
sp...@google.com <sp...@google.com>
to...@gmail.com <to...@gmail.com> #15
For the record also tested with A9 and there's the result on Windows.
Image is content of the aab (res and BUNDLE-METADATA)
And the result of a search on all the app folder including all the build dirs after the build
PS D:\_Gradle\Symfonik> Get-Childitem -Include *baseline* -Recurse
Directory: D:\_Gradle\Symfonik\app\src\main
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 29/11/2022 10:58 2114655 baseline-prof.txt
Directory: D:\_Gradle\Symfonik\benchmark\src\main\java\app\symfonik\benchmark
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 29/11/2022 10:48 baselineprofile
Directory: D:\_Gradle\Symfonik\benchmark\src\main\java\app\symfonik\benchmark\baselineprofile
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 29/11/2022 10:48 1231 BaselineProfileGenerator.kt
Reverting to A7 generates an aab that is 15k larger (the size of the baseline)
And the search after the build gives:
PS D:\_Gradle\Symfonik> Get-Childitem -Include *baseline* -Recurse
Directory: D:\_Gradle\Symfonik\app\build\intermediates\binary_art_profile\release
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 02/12/2022 20:17 14796 baseline.prof
Directory: D:\_Gradle\Symfonik\app\build\intermediates\binary_art_profile_metadata\release
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 02/12/2022 20:17 1805 baseline.profm
Directory: D:\_Gradle\Symfonik\app\build\intermediates\merged_art_profile\release
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 02/12/2022 20:12 2303810 baseline-prof.txt
Directory: D:\_Gradle\Symfonik\app\src\main
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 29/11/2022 10:58 2114655 baseline-prof.txt
Directory: D:\_Gradle\Symfonik\benchmark\src\main\java\app\symfonik\benchmark
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 29/11/2022 10:48 baselineprofile
Directory: D:\_Gradle\Symfonik\benchmark\src\main\java\app\symfonik\benchmark\baselineprofile
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 29/11/2022 10:48 1231 BaselineProfileGenerator.kt
So the files are properly generated in binary_art_profile
for A7 and completely missing in A8 / A9. This does not sound like a packaging issue (Same behavior without the options from #8) but more a missing generation step.
This is a full compose app, no jetifier, minsdk 28, no png generation, ultra optimized everywhere I can, so maybe the build step depends on a step that is missing now?
sp...@google.com <sp...@google.com> #16
Thanks. I'm able to repro now with the correct link
sp...@google.com <sp...@google.com> #17
It looks like this was caused by Change-Id: I68ab3a6f342327cfb4c5477f85941fa3a6434a81. When I revert that change, the issue goes away. Working on a fix...
sp...@google.com <sp...@google.com> #20
This will be fixed in AGP 8.0.0-beta02 (Change-Id: Icb1a29bcd0c60a8ee6228a5ee05e708624c319c0)
to...@gmail.com <to...@gmail.com> #21
Thanks a lot, just to be sure this was also tested with both options from #8?
to...@gmail.com <to...@gmail.com> #22
So updated to AGP 8.0 A10 and the profiles are back but still in com.android.tools.build.profiles
this contradicts #6 is this normal/expected will it change in a future 8.0 build?
sp...@google.com <sp...@google.com> #23
Re #22, please disregard #6... that only applies to APKs, not AABs.
ma...@google.com <ma...@google.com> #24
Is there an alpha that includes this fix?
sp...@google.com <sp...@google.com> #25
The fix will be in AGP 8.0.0-beta02 and AGP 8.1.0-alpha01
Description
DESCRIBE THE ISSUE IN DETAIL:
STEPS TO REPRODUCE:
ATTACH SCREENSHOTS/RECORDINGS OF THE ISSUE
ATTACH LOG FILES (Select Help > Show Log in Files, or Show Log in Finder on a Mac)
IMPORTANT: Please readhttps://developer.android.com/studio/report-bugs.html carefully and supply
all required information.
Studio Build: Flaming A8 Version of Gradle Plugin: 8.0.0 A8 Version of Gradle: 7.6-rc-3 Version of Java: 11 OS: Windows