Status Update
Comments
je...@google.com <je...@google.com>
lu...@google.com <lu...@google.com> #2
mi...@mercurydevelopment.com <mi...@mercurydevelopment.com> #3
lu...@google.com <lu...@google.com> #4
lu...@google.com <lu...@google.com> #5
mi...@mercurydevelopment.com <mi...@mercurydevelopment.com> #6
Android Studio version: 0.8.12
buildToolsVersion 21.0.1
Gradle 1.11
lu...@google.com <lu...@google.com>
mi...@mercurydevelopment.com <mi...@mercurydevelopment.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.
lu...@google.com <lu...@google.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 (
yu...@gmail.com <yu...@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
d....@pay-s.ru <d....@pay-s.ru> #10
dexOptions {
additionalParameters = ['--multi-dex', '--set-max-idx-number=40000']
}
da...@gmail.com <da...@gmail.com> #11
ro...@gmail.com <ro...@gmail.com> #14
> Task :app:shrinkReleaseRes FAILED
Execution failed for task ':app:shrinkReleaseRes'.
> A failure occurred while executing com.android.build.gradle.internal.transforms.ShrinkProtoResourcesAction
> ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
outware_logo.xml
efbb bf3c 7665 6374 6f72 2078 6d6c 6e73
3a61 6e64 726f 6964 3d22 6874 7470 3a2f
2f73 6368 656d 6173 2e61 6e64 726f 6964
2e63 6f6d 2f61 706b 2f72 6573 2f61 6e64
726f 6964 220d 0a20 2020 2061 6e64 726f
...
I believe I got this outware_logo.xml from this tutorial a while back, didn't realize I still had it in my project this whole time:
distributionUrl=https\://
classpath 'com.android.tools.build:gradle:7.4.0'
d....@pay-s.ru <d....@pay-s.ru> #15
ya...@gmail.com <ya...@gmail.com> #16
tr...@gmail.com <tr...@gmail.com> #17
Execution failed for task ':app:shrinkStagingRes'.
> A failure occurred while executing com.android.build.gradle.internal.transforms.ShrinkProtoResourcesAction
> ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
kotlin_version = '1.8.10'
classpath 'com.android.tools.build:gradle:7.4.2'
gradle-7.5
bu...@gmail.com <bu...@gmail.com> #18
It could be fixed on 7.4.2?
rj...@gmail.com <rj...@gmail.com> #19
gi...@indiamart.com <gi...@indiamart.com> #20
li...@gmail.com <li...@gmail.com> #21
au...@gmail.com <au...@gmail.com> #22
I'm also have this same error with zoom in flutter
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:shrinkReleaseRes'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.transforms.ShrinkProtoResourcesAction
> ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
> A failure occurred while executing com.android.build.gradle.internal.transforms.ShrinkProtoResourcesAction
> ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
> A failure occurred while executing com.android.build.gradle.internal.transforms.ShrinkProtoResourcesAction
> ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 6m 28s
Running Gradle task 'assembleRelease'... 389.5s
Gradle task assembleRelease failed with exit code 1
zoom_native_sdk: ^0.3.3
Flutter 3.10.5 • channel stable •
java version "17.0.7" 2023-04-18 LTS Java(TM) SE Runtime Environment (build 17.0.7+8-LTS-224) Java HotSpot(TM) 64-Bit Server VM (build 17.0.7+8-LTS-224, mixed mode, sharing)
Gradle 7.6.1
Build time: 2023-02-24 13:54:42 UTC Revision: 3905fe8ac072bbd925c70ddbddddf4463341f4b4
Kotlin: 1.7.10 Groovy: 3.0.13 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17.0.7 (Oracle Corporation 17.0.7+8-LTS-224) OS: Windows 11 10.0 amd6
sa...@pocketfm.com <sa...@pocketfm.com> #23
ar...@gmail.com <ar...@gmail.com> #24
ng...@gmail.com <ng...@gmail.com> #25
sg...@google.com <sg...@google.com> #26
Manually updating the .xml
files to not have a BOM should be a way to workaround this issue. Most text editors have a way of saving without a BOM.
Description
Our app uses Zoom SDK which contains files like this in res/raw folder:
As you can see there is an empty line after xml declaration.
Both AGP 7.3.0-beta03 and AGP 7.4.0-alpha04 can't build an app containing this file with the following exception:
When there is no files with an empty line after xml declaration ShrinkResourcesNewShrinkerTask executes correctly.
AGP 7.3.0-beta02 doesn't have this issue.
The issue is probably related to these changes:https://cs.android.com/android-studio/platform/tools/base/+/a01dac7c7fff60e3f98c90f50f5295415f623b80