执行 linux机器上 执行gradle 构建

[root@uranuspreapp30 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即可!





Logo

更多推荐