java.lang.NoClassDefFoundError: com/android/build/gradle/internal/ToolingRegistryProvider
程序员文章站
2022-07-14 08:52:10
...
执行 linux机器上 执行gradle 构建
[aaa@qq.com app]# gradle clean build --info > /opt/test1.txt
FAILURE: Build failed with an exception.
* Where:
Build file '/data/jenkins/jobs/testlxl/app/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.NoClassDefFoundError: com/android/build/gradle/internal/ToolingRegistryProvider
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
原因是使用 gradle.jar 版本太低!!
buildscript {
repositories {
//jcenter()
maven { url "http://maven.cnsuning.com/content/groups/public/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
//classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1'//greendao gradle插件
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// TinkerPatch 插件
//classpath "com.tencent.tinker:tinker-patch-gradle-plugin:1.9.2"
// freeline
//classpath 'com.antfortune.freeline:gradle:0.8.8'
}
}
'com.android.tools.build:gradle:2.2.0' 换成2.3.3即可!
推荐阅读
-
AndroidStudio 报错:Could not find com.android.tools.build:gradle
-
Flutter Could not resolve com.android.tools.build:gradle:xx.xx.xx
-
java.lang.NoClassDefFoundError: com/android/build/gradle/internal/ToolingRegistryProvider
-
Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.2/gradle-3
-
AndroidStudio 报错:Could not find com.android.tools.build:gradle
-
Flutter Could not resolve com.android.tools.build:gradle:xx.xx.xx
-
解决Android Studio4.0:Could not find com.android.tools.build:gradle:5.1.1. Searched in the following