更新到buildTools 27.0.3后,Gradle failling

时间:2018-03-27 17:02:37

标签: android gradle android-gradle gradlew

更新到构建工具27.0.3后,我的构建停止了NullPointerException。

$ ./gradlew main:build
Starting a Gradle Daemon (subsequent builds will be faster)
Parallel execution with configuration on demand is an incubating feature.

> Configure project :main 
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)


FAILURE: Build failed with an exception.

* What went wrong:
Failed to notify task execution graph listener.
> java.lang.NullPointerException (no error message)
> java.lang.NullPointerException (no error message)

fullstacktrace:https://gist.github.com/plentz/59b676fc86dd4c3bfe2333c89b82c506

build.gradle:https://gist.github.com/plentz/eac62d1c5d207affba6153b0efb2e1ca

2 个答案:

答案 0 :(得分:1)

我在 AGP 3.1.0 3.1.1 上也遇到了这个问题。我将插件降级为 3.0.0 来解决这个问题,但是再考虑一下,我决定继续使用 AGP 3.2.0 alpha ,问题似乎已得到解决。

这个bug似乎在alpha修订版的某个地方修复了,所以继续使用最新版本,现在就是AGP 3.2.0-alpha10。 :)

答案 1 :(得分:0)

尝试删除your_project_path/.gradle,然后重新启动Android studio并重新编译项目