Android Gradle Plugin v3.6.0/3.6.1 构建Bug

升级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已经提交官方后续版本会修复。

2、降级到 AGP v3.5.x

参考:https://stackoverflow.com/questions/60896733/execution-failed-for-task-appminifyreleasewithr8-java-lang-nullpointerexcept

posted @ 2020-03-31 17:16  millerkevin  阅读(1302)  评论(0编辑  收藏  举报