Description
Hi, I’ve encountered an issue when creating an apps with AGP version 7.3.1, Kotlin version 1.7.0 and using latest Zoom Meeting SDK. It throws error :
Execution failed for task ':app:shrinkBenchmarkRes'.
> 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.
It’s only happen when I tried to set shrinkResources true
Which Android Meeting SDK version?
v5.13.1.11014
To Reproduce
Steps to reproduce the behavior:
Create a new android project with AGP version 7.3.1
Add Zoom Meeting SDK
Set shrinkResources true in your build types
Then try to run/build the apps. It will throw an error as I mentioned above.
Thank you for your post here in the forum. The error you’re getting may be because of the wrong file format. To be sure, could you check the following points to make sure the settings are correct:
-Was ‘minifyEnabled: true’ added to your build.grable?
-Was your progaurd file in the correct format?
-keep class us.zoom.**{*;}
-keep class com.zipow.**{*;}
-keep class us.zipow.**{*;}
-keep class org.webrtc.**{*;}
-keep class us.google.protobuf.**{*;}
-keep class com.google.crypto.tink.**{*;}
-keep class androidx.security.crypto.**{*;}
I still got the error :
Execution failed for task ':sample:shrinkDebugRes'.
> 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.
Would you please try to upgrade the meeting SDK version to 5.13.5? We’ve just published it yesterday and I tested it with shrinkResources true which works fine.
Thank you
Thanks, @elaine.ku for the update, but I still encountered the problem using SDK version 5.13.5.11583. I might be missed something. I still test using the sample project mobile-rtc-android-studio and here’s my patch :
I did everything that you have done with the sample app and am still not able to reproduce the issue. However, I’ve found someone else facing the same issue as you. Would you please try to remove the blank line in the XML files that are in res/ folder?
Ex:
Change
Still no luck, I’ve deleted the empty line. Actually, if I use AGP 8.0.0-beta01 it works, but I consider not upgrading to AGP 8 yet and waiting for stable version. I end up using AGP 7.4.0 and add this in gradle.properties
android.enableNewResourceShrinker=false
Seems like they have a bug in the new shrink method and fixed in Gradle 8. ref: Google Issue Tracker