Status Update
Comments
je...@google.com <je...@google.com>
lu...@google.com <lu...@google.com> #2
lu...@google.com <lu...@google.com> #4
for all who are looking for a solution use this:
lu...@google.com <lu...@google.com> #5
Taking a look at the raw/raw.xml bytes:
0000000 357 273 277 < ? x m l v e r s i o n
ef bb bf 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e
0000020 = " 1 . 0 " e n c o d i n g =
3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d
0000040 " u t f - 8 " ? > \n < a p p n
The ef bb bf
represents a byte-order marker. This causes the XMLStreamReader to throw an exception. This can be easily fixed by using a BOMInputStream. I'll cherry pick this fix back to 7.3, so it will hopefully be included in 7.3.0-beta03.
mi...@mercurydevelopment.com <mi...@mercurydevelopment.com> #6
Thank you!
lu...@google.com <lu...@google.com>
mi...@mercurydevelopment.com <mi...@mercurydevelopment.com> #7
Still reproduced in 8.0.0-alpha01
lu...@google.com <lu...@google.com> #8
Some delay in getting the change merged, it is merged in 8.0.0-alpha03.
yu...@gmail.com <yu...@gmail.com> #9
d....@pay-s.ru <d....@pay-s.ru> #10
da...@gmail.com <da...@gmail.com> #11
Me as well.
da...@gmail.com <da...@gmail.com> #12
Also just tried 7.4.0-rc01 and that is failing with the same exception.
I haven't noticed anything that lets me know what file (or files) the parse error is happening on, which makes it even harder.
I've been able to verify that for all of the files in our repository have both the xml declaration at the top + no extra returns through a few find commands. I've also gone through all XML files and reformatted them against our editor config, so it's got to be from an outside resource.
Examples of commands and editor config:
all XML files lacking <?xml as the first line:\
find . -type f -name "*.xml" -print0 | xargs -0 -I{} awk 'NR==1&&!/^<\?xml/{print FILENAME}' {}
all XML files with 1 or more extra line breaks after the XML tag declaration:\
find . -type f -name "*.xml" -print0 | xargs -0 -I{} awk 'NR==1&&/^<\?xml.*\n{2,}/{print FILENAME}' {}
editorconfig:
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
ra...@gmail.com <ra...@gmail.com> #13
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