Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not set unknown property 'implementation' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

I was adding new dependencies for new android-kotlin project but getting the following error after sync the project.

Could not set unknown property 'implementation' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Following is my build.gradle file.

apply plugin: 'com.android.application'    
apply plugin: 'kotlin-android'    
apply plugin: 'kotlin-android-extensions'    
apply plugin: 'kotlin-kapt'    
apply plugin: 'androidx.navigation.safeargs'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.samplekotlin"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding.enabled = true
}

def lifeCycleExtensionVersion = '1.1.1'
def supportVersion = '28.0.0'
def retrofitVersion = '2.3.0'
def glideVersion = '4.9.0'
def rxJavaVersion = '2.1.1'
def roomVersion = '2.1.0-rc01'
def navVersion = '2.1.0-alpha05'
def preferencesVersion = '1.0.0'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation = "com.android.support:design:$supportVersion"
    implementation = "android.arch.lifecycle:extension:$lifeCycleExtensionVersion"
    implementation =  "androidx.room:room-runtime:extension:$roomVersion"
    implementation = "androidx.legacy:legacy-support-v4:1.0.0"
    kapt "androidx.room:room-compiler:$roomVersion"
    implementation = "androidx.room:room-ktx:$roomVersion"
    implementation = "org.jetbrains.kotlinx:kotlinx-coroutine-core:1.1.1"

    implementation = "androidx.navigation:navigation-fragment-ktx:$navVersion"
    implementation = "androidx.navigation:navigation-ui-ktx:$navVersion"
    implementation = "com.google.android.material:material:1.0.0"

    implementation = "com.squareup.retrofit2:retrofit:$retrofitVersion"
    implementation = "com.squareup.retrofit2:converter-gson:$retrofitVersion"
    implementation = "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"

    implementation = "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
    implementation = "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"

    implementation = "com.github.bumptech.glide:glide:$glideVersion"

    implementation = "com.android.support:palette-v7:$supportVersion"

    implementation = "androidx.preference:preference:$preferencesVersion"

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

After the click on sync button, getting the 'implementation' error.

like image 681
Ritesh Avatar asked Oct 22 '25 08:10

Ritesh


1 Answers

Foolish Mistake. Found the issue. Just removed = operator

implementation =

like image 129
Ritesh Avatar answered Oct 24 '25 22:10

Ritesh



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!