今天在尝试编译sunflowers(https://github.com/googlesamples/android-sunflower)项目时, 编译报错:
Error:Plugin [id: 'com.diffplug.gradle.spotless', version: '3.13.0'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.diffplug.gradle.spotless:com.diffplug.gradle.spotless.gradle.plugin:3.13.0')
Searched in the following repositories:
Gradle Central Plugin Repository
不明觉厉!
项目中的说明, 也无法照着使用, 也会报错.
最后这么处理的:
- 升级android studio 至3.2 (我这里是beta4版本) 并关闭android studio
- 在项目根目录下执行: .\gradlew assembleDebug
然后重新打开android studio, 再次编译就可以了.