# Apps build failed after upgrading AGP to 7.3.1

**URL:** <https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151>\
**Category:** Android\
**Created:** [January 9, 2023, 9:24am UTC](https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151 "2023-01-09T09:24:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![wildhan](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/wildhan/32/44320_2.png) [@wildhan](https://devforum.zoom.us/u/wildhan)\
**Post date:** [January 9, 2023, 9:24am UTC](https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151/1 "2023-01-09T09:24:13Z")

</div>

**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 :

```auto
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:

1. Create a new android project with AGP version 7.3.1
2. Add Zoom Meeting SDK
3. Set `shrinkResources true` in your build types
4. Then try to run/build the apps. It will throw an error as I mentioned above.

---

<div class="post-metadata">

**Author:** ![rehema.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rehema.zoom/32/40323_2.png) [@rehema.zoom](https://devforum.zoom.us/u/rehema.zoom)\
**Post date:** [January 11, 2023, 6:30pm UTC](https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151/3 "2023-01-11T18:30:27Z")

</div>

Hi @wildhan ,

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?

Thanks,  
Rehema

---

<div class="post-metadata">

**Author:** ![wildhan](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/wildhan/32/44320_2.png) [@wildhan](https://devforum.zoom.us/u/wildhan)\
**Post date:** [January 12, 2023, 2:52am UTC](https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151/4 "2023-01-12T02:52:36Z")

</div>

> [@wildhan](#):
>
> shrinkResources

Hi @rehema.zoom, yes already included that one.

```auto
benchmark {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.debug
            debuggable false
        }

```

I also tried using Zoom Sample Apps(bundled when download meeting SDK) update the AGP to 7.3.1 then modify build type to :

```auto
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'

```

Proguard :

```auto
-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 :

```auto
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.

```

---

<div class="post-metadata">

**Author:** ![elaine.ku](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elaine.ku/32/40026_2.png) [@elaine.ku](https://devforum.zoom.us/u/elaine.ku)\
**Post date:** [January 18, 2023, 7:13pm UTC](https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151/5 "2023-01-18T19:13:51Z")

</div>

Hello @wildhan ,

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

Elaine

---

<div class="post-metadata">

**Author:** ![wildhan](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/wildhan/32/44320_2.png) [@wildhan](https://devforum.zoom.us/u/wildhan)\
**Post date:** [January 25, 2023, 7:19am UTC](https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151/6 "2023-01-25T07:19:12Z")

</div>

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` :

```auto
Index: example2/src/main/java/us/zoom/sdkexample2/Constants.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/example2/src/main/java/us/zoom/sdkexample2/Constants.java b/example2/src/main/java/us/zoom/sdkexample2/Constants.java
--- a/example2/src/main/java/us/zoom/sdkexample2/Constants.java	(revision 5a2d6548e9a3f7331273474bb4543121350c0151)
+++ b/example2/src/main/java/us/zoom/sdkexample2/Constants.java	(date 1674630498313)
@@ -24,6 +24,6 @@
      * "tokenExp": long // token expire time
      * }
      */
- public final static String SDK_JWTTOKEN = YOUR JWTTOKEN;
+ public final static String SDK_JWTTOKEN = "";
 
 }
Index: gradle/wrapper/gradle-wrapper.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>ISO-8859-1
===================================================================
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
--- a/gradle/wrapper/gradle-wrapper.properties	(revision 5a2d6548e9a3f7331273474bb4543121350c0151)
+++ b/gradle/wrapper/gradle-wrapper.properties	(date 1674628728007)
@@ -3,4 +3,4 @@
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
Index: sample/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sample/build.gradle b/sample/build.gradle
--- a/sample/build.gradle	(revision 5a2d6548e9a3f7331273474bb4543121350c0151)
+++ b/sample/build.gradle	(date 1674630449474)
@@ -21,11 +21,13 @@
     buildTypes {
         release {
             minifyEnabled true
+ shrinkResources true
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
         }
 
         debug {
             minifyEnabled true
+ shrinkResources true
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
         }
 
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle	(revision 5a2d6548e9a3f7331273474bb4543121350c0151)
+++ b/build.gradle	(date 1674628880508)
@@ -9,7 +9,7 @@
         google()
     }
     dependencies {
- classpath 'com.android.tools.build:gradle:7.1.2'
+ classpath 'com.android.tools.build:gradle:7.3.1'
     }
 }
 

```

---

<div class="post-metadata">

**Author:** ![elaine.ku](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elaine.ku/32/40026_2.png) [@elaine.ku](https://devforum.zoom.us/u/elaine.ku)\
**Post date:** [January 26, 2023, 2:01am UTC](https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151/7 "2023-01-26T02:01:05Z")

</div>

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

```auto
<?xml version="1.0" encoding="utf-8"?>

<app name="" version="1.1">

```

To

```auto
<?xml version="1.0" encoding="utf-8"?>
<app name="" version="1.1">

```

and see whether this solves the issue. If it would be the root cause, I’ll check internally and update those XML files in the later release.

---

<div class="post-metadata">

**Author:** ![wildhan](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/wildhan/32/44320_2.png) [@wildhan](https://devforum.zoom.us/u/wildhan)\
**Post date:** [January 26, 2023, 4:37am UTC](https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151/8 "2023-01-26T04:37:29Z")

</div>

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

```auto
android.enableNewResourceShrinker=false

```

Seems like they have a bug in the new shrink method and fixed in Gradle 8. ref: [Google Issue Tracker](https://issuetracker.google.com/issues/235863809?pli=1)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [February 25, 2023, 2:37pm UTC](https://devforum.zoom.us/t/apps-build-failed-after-upgrading-agp-to-7-3-1/81151/9 "2023-02-25T14:37:42Z")

</div>

Closed on February 25, 2023, 2:37pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
