NoClassDefFoundError: com / android / build / gradle / internal / ToolingRegistryProvider

I have an Android project that now fails to build:

FAILURE: Build failed with an exception.

* Where:
Build file 'build.gradle' line: 28

* What went wrong:
A problem occurred evaluating root project 'X'.
> java.lang.NoClassDefFoundError: com/android/build/gradle/internal/ToolingRegistryProvider

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

The project was built perfectly with the following dependencies:

'com.android.tools.build:gradle:2.1.3'
'com.android.tools.build:gradle-experimental:0.7.3'

The employee used the updates offered by AndroidStudio. This changed the plugin versions to:

'com.android.tools.build:gradle:2.2.0'
'com.android.tools.build:gradle-experimental:0.8.0'

After this update, the project is successfully built on its development machine (Windows 7) and on mine (Ubuntu 16.04). The error occurs when building the Jenkins server (Ubuntu 16.04). I installed the available updates for the Android SDK components on the build server, but the error persists.

A google search for"ToolingRegistryProvider" returns "Search does not match documents."

+4
source share
3 answers

gradle , .

rm -r ~/.gradle/caches/modules-2
+1

: jcenter() .

Nexus, , . , gradle, Nexus, - , , gradle gradle . , jcenter() gradle , .

+1

- Google Maven build.gradle:

allprojects {
    repositories {
        google()

        // If you're using a version of Gradle lower than 4.1, you must instead use:
        // maven {
        //     url 'https://maven.google.com'
        // }
        // An alternative URL is 'https://dl.google.com/dl/android/maven2/'
    }
}

. .

0
source

Source: https://habr.com/ru/post/1656129/


All Articles