I recently upgraded the Android Gradle Plugin in my Android app project from version 7.4.2 to 8.2.2. However, I'm now encountering an error during the release build when the minifyReleaseWithR8 task is executed.
The error message I'm getting is as follows:
Task :app:minifyKioskDebugWithR8 FAILED AGPBI: {"kind":"error","text":"com.android.tools.r8.ResourceException: com.android.tools.r8.internal.vc: I/O exception while reading '/Users/harinikesh/StudioProjects/instore/app/build/intermediates/merged_java_res/kioskDebug/base.jar': /Users/harinikesh/StudioProjects/instore/app/build/intermediates/merged_java_res/kioskDebug/base.jar","sources":[{"file":"/Users/harinikesh/StudioProjects/instore/app/build/intermediates/merged_java_res/kioskDebug/base.jar"}],"tool":"R8"} com.android.tools.r8.ResourceException: com.android.tools.r8.internal.vc: I/O exception while reading '/Users/harinikesh/StudioProjects/instore/app/build/intermediates/merged_java_res/kioskRelease/base.jar': /Users/harinikesh/StudioProjects/instore/app/build/intermediates/merged_java_res/kioskRelease/base.jar
I got this error while generating the release build with
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'}
I tried making the shrinkResources and minifyEnabled to false, Build got successful.
These errors only started occurring after I updated the Android Gradle Plugin. I've tried cleaning the project and ensuring that all dependencies are up to date, but the issue persists.
Has anyone else encountered a similar issue when upgrading to Android Gradle Plugin 8.2.2? How can I resolve these errors and successfully minify my release build with R8?
./gradlew --stacktrace :app:minifyReleaseWithR8
. – Cutcherrytasks.whenTaskAdded {}
It worked fine. But with it, still shows the same error. – Included