[英]Could not find org.codehaus.groovy:groovy-all:2.4.12
After an update of android studio and gradle, I can not compile (in release mode) my application anymore.When I try to generate the APK, I receive this error:更新 android studio 和 gradle 后,我无法再编译(在发布模式下)我的应用程序。当我尝试生成 APK 时,收到此错误:
Could not find org.codehaus.groovy:groovy-all:2.4.12.
找不到 org.codehaus.groovy:groovy-all:2.4.12。 Searched in the following locations: file:/Users/antonioleva/Library/Android/sdk/extras/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.pom file:/Users/antonioleva/Library/Android/sdk/extras/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar file:/Users/antonioleva/Library/Android/sdk/extras/google/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.pom file:/Users/antonioleva/Library/Android/sdk/extras/google/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar file:/Users/antonioleva/Library/Android/sdk/extras/android/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.pom file:/Users/antonioleva/Library/Android/sdk/extras/android/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar https://maven.google.com/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.pom https://maven.google.com/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar Required by: projec
在以下位置搜索:文件:/Users/antonioleva/Library/Android/sdk/extras/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.pom 文件:/Users /antonioleva/Library/Android/sdk/extras/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar 文件:/Users/antonioleva/Library/Android/sdk/extras /google/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.pom 文件:/Users/antonioleva/Library/Android/sdk/extras/google/m2repository/org/codehaus /groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar 文件:/Users/antonioleva/Library/Android/sdk/extras/android/m2repository/org/codehaus/groovy/groovy-all/2.4 .12/groovy-all-2.4.12.pom 文件:/Users/antonioleva/Library/Android/sdk/extras/android/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4 .12.jar https://maven.google.com/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.pom https://maven.google.com/org/codehaus /groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar需要:项目t : > com.android.tools.lint:lint-gradle:26.1.3
t : > com.android.tools.lint:lint-gradle:26.1.3
This is my gradle:这是我的毕业证书:
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
}
}
apply plugin: 'android'
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.android.support:multidex:1.0.1') {
exclude module: 'support-v4'
exclude module: 'support-fragment'
exclude module: 'internal_impl-23.0.1'
}
implementation('com.android.support:support-v4:23.0.1') {
exclude module: 'support-v4'
exclude module: 'support-fragment'
exclude module: 'internal_impl-23.0.1'
}
implementation('com.android.support:appcompat-v7:23.0.1') {
exclude module: 'support-v4'
exclude module: 'internal_impl-23.0.1'
exclude module: 'support-fragment'
}
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
//implementation 'org.codehaus.groovy:groovy-all:2.4.12'
}
android {
compileSdkVersion 23
buildToolsVersion '27.0.3'
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude '...'
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
androidTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
Worked fine for me 对我来说很好
build.gradle build.gradle
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
}
google()
}
...
}
...
repositories {
google()
jcenter()
maven {
url "https://jitpack.io"
}
}
app/build.gradle app / build.gradle
dependencies {
implementation 'org.codehaus.groovy:groovy-all:2.4.12'
}
I had the same problem, everything was correctly installed but not found; 我遇到了同样的问题,所有内容均已正确安装,但未找到; I also refreshed everything that was refreshable in IntelliJ;
我还刷新了IntelliJ中所有可刷新的内容。 I removed all the temporary folders in the project.
我删除了项目中的所有临时文件夹。 Everything was useless.
一切都没有用。
Then I solved the problem like that, from terminal: 然后我从终端解决了这样的问题:
gradlew build --refresh-dependencies
This solved the issue. 这解决了问题。
In extremis, you can delete the content of the global cache folder used by gradle (it was not necessary in my case); 在极端情况下,您可以删除gradle使用的全局缓存文件夹的内容(在我的情况下是没有必要的)。 for example could be this:
例如可能是这样的:
C:\Users\USERNAME\.gradle\caches
Mi esperas, ke tio helpos iun, ĉar mi perdis multe da tempo. Mi esperas,ke tio helpos iun,ĉarmi perdis multe da tempo。
Try to check youre Internet Conection.尝试检查您的 Internet 连接。 codehaus is blacklisted on some of these.
codehaus 在其中一些被列入黑名单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.