com.diffplug.gradle.spotless was not found in any of the following sources 编译错误处理

今天在尝试编译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

不明觉厉!
项目中的说明, 也无法照着使用, 也会报错.

最后这么处理的:

  1. 升级android studio 至3.2 (我这里是beta4版本) 并关闭android studio
  2. 在项目根目录下执行: .\gradlew assembleDebug

然后重新打开android studio, 再次编译就可以了.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容