Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caused by: java.lang.NoClassDefFoundError: org/gradle/internal/impldep/com/google/common/collect/Lists

When I am creating a new project in Android Studio, and load old projects I got this

java.lang.NoClassDefFoundError: org/gradle/internal/impldep/com/google/common/collect/Lists**
**java.lang.ClassNotFoundException: org.gradle.internal.impldep.com.google.common.collect.Lists
ERROR: Unable to load class 'org.gradle.internal.impldep.com.google.common.collect.Lists'

this is my gradle

plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    compileSdkVersion 29
    buildToolsVersion "30.0.0"

    defaultConfig {
        applicationId "com.ncf.fitness"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

2 Answers

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

You didn't add kotlin version. Try adding kotlin version instead of $kotlin_version.

testImplementation 'junit:junit:4.+'

It also looks like it hasn't complete version name.

Then sync

This helped me when I downgraded the gradle plugin. Before the version as on the screen enter image description here

like image 22
Segrei Ulanov Avatar answered Oct 14 '25 13:10

Segrei Ulanov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!