4
votes

I have the following errors when building the project. here is the error

Executing tasks: [clean, :app:assembleDebug] in project E:\ReloTrack

Could not resolve compiler classpath. Check if Kotlin Gradle plugin repository is configured in project ':app'.

FAILURE: Build failed with an exception.

BUILD FAILED in 8s

And here is my gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'



android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.webline.relotrack"
        minSdkVersion 22
        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 kotlin_version

        targetCompatibility kotlin_version

    }

// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)


    kotlinOptions {
        jvmTarget = "1.8"
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72"
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-database:19.3.0'
    implementation 'com.google.firebase:firebase-messaging:20.1.6'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.navigation:navigation-fragment:2.2.2'
    implementation 'androidx.navigation:navigation-ui:2.2.2'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
    implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    //Libraries
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'com.karumi:dexter:6.1.0'
    implementation 'com.firebaseui:firebase-ui-database:4.3.1'
    implementation 'com.firebaseui:firebase-ui-auth:4.3.2'
    implementation 'com.github.d-max:spots-dialog:1.1@aar'
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation 'com.github.mancj:MaterialSearchBar:0.8.2'
    //RxJava2
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
    //Retrofit
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.8.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.8.1'

    implementation 'io.paperdb:paperdb:2.6'

}

1
See my answer for this question and modify your dependencies like it. stackoverflow.com/questions/61025926/…MMG
Thanks. I tried it. But I got the same error :( as comment belowsangeeth
You copy and paste dependencies of that answer?!MMG
Yes, I did samesangeeth
It works for me, check internet connection, maybe you should turn on VPNMMG

1 Answers

0
votes

I have checked your gradle File, and i can see, you forgot to apply one more plugin for kotlin

It should be like

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'