欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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即可!

java.lang.NoClassDefFoundError: com/android/build/gradle/internal/ToolingRegistryProvider