gpt4 book ai didi

Android Studio 找不到库

转载 作者:行者123 更新时间:2023-11-29 02:24:44 27 4
gpt4 key购买 nike

当我尝试构建项目时,我遇到了新的 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
}

关于Android Studio 找不到库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52975725/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com