Search code examples
androidflutterandroid-gradle-pluginbuild.gradle

ShrinkProtoResourcesAction Premature end of file


Gradle is not able to generate release APK files. The build ends with a build error similar to the following.

    Execution failed for task ':app:shrinkReleaseRes'.
> A failure occurred while executing com.android.build.gradle.internal.transforms.ShrinkProtoResourcesAction
   > ParseError at [row,col]:[21,1]
     Message: Premature end of file.

Other symptoms include:

  • Not able to open or find ShrinkProtoResourcesAction file.
  • Everything in the Proguard file seems ok.
  • Still able to generate .aab files.

Additionally happens when running flutter build apk


Solution

  • I found the issue, there was some empty xml been added which was causing the error.