升级AndroidStudio AGP(Android Gradle Plugin)到 3.6.0/3.6.1版本后打包会出现如下异常:
Execution failed for task ‘:app:minifyReleaseWithR8‘.java.lang.NullPointerException (no error message)
解决方式:
1、升级R8 AGP(Android Gradle Plugin)版本
buildscript {
repositories {
maven {
url ‘https://storage.googleapis.com/r8-releases/raw‘
}
}
dependencies {
classpath ‘com.android.tools:r8:1.6.82‘ // Must be before the Gradle Plugin for Android.
classpath ‘com.android.tools.build:gradle:X.Y.Z‘ // Your current AGP version.
}
}
目前该Bug已经提交官方后续版本会修复。