android - Android Studio 未找到库
问题描述
当我尝试构建项目时,新的 Android Studio 版本(3.2.1)遇到了很多问题。
我正在使用 android-sunflower(jetpack 集成)项目,但出现以下错误。
其他人是否收到此错误?
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
Open File
解决方案
将此调整为您项目的顶级 build.gradle 文件。添加插件和一尘不染。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "com.diffplug.gradle.spotless" version "3.4.0"
}
allprojects {
repositories {
jcenter()
}
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
}
apply plugin: 'com.diffplug.gradle.spotless'
spotless {
java {
target "**/*.java"
trimTrailingWhitespace()
removeUnusedImports()
googleJavaFormat()
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
推荐阅读
- php - WordPress 调试:WP_Http 和通知 | briarnblaar.co.za | 严重错误屏幕
- c# - 如何使用 enum 和 json 在数据库中插入数据?
- git - Git 和 SHA-256
- r - 查找矩阵数组的索引,该索引最接近 R 中另一个矩阵的每个元素
- svg - 将 SVG 组转换为 3D 形状 | 用 Three.js 增加厚度
- c++ - 了解默认模板参数何时是重定义以及何时不在 SFINAE 技术中
- c - 为什么我在 C 中的罪孽计算代码返回错误的值?
- amazon-web-services - 大型(> 1MB)响应json的Kastrel调整
- jmeter - Jmeter - 使用 JSR223 后处理器调用 javascript
- pdf - PDF 是否支持数据降级保护?