Rishabh Ryber
Rishabh Ryber

Reputation: 466

I haven't used compile anywhere still getting "Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'"

I haven't used compile anywhere either in App or Project level build.gradle file. But still I am getting this error.

I went through other questions related to this on stackoverflow but most solutions suggested to replace compile with api or implementation, But since I didn't use it anywhere I can't find a fix. Please help.

App Level build.gradle

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

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.smartseller"
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    implementation 'com.google.firebase:firebase-database:17.0.0'
    implementation 'com.android.support:design:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:gridlayout-v7:28.0.0'
    implementation 'com.google.zxing:core:3.2.1'
    implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
}

Project Level build.gradle


buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Warning Code I got

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app

I am using android studio version 3.4.1

Upvotes: 1

Views: 189

Answers (2)

Astha Garg
Astha Garg

Reputation: 1122

Try updating com.google.gms:google-services from 3.0.0 to 3.2.0 or any other latest version.

Upvotes: 1

Arbaz.in
Arbaz.in

Reputation: 1558

Change this in your App Level build.gradle might be issue with this dependency

Replace this

     implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'

With this

 implementation 'com.journeyapps:zxing-android-embedded:3.6.0'

-:For Android 14+ support, downgrade zxing:core to 3.3.0 or earlier:-

  implementation('com.journeyapps:zxing-android-embedded:3.6.0') { transitive = false }
  implementation 'com.google.zxing:core:3.3.0'

Reference Link

Happy Learning ...

Upvotes: 2

Related Questions