Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation'. #555

Closed
Amagi82 opened this issue Mar 8, 2018 · 17 comments

Comments

@Amagi82
Copy link

Amagi82 commented Mar 8, 2018

In your build.gradle files, "compile" was deprecated about 6 months ago in favor of "implementation"

https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html

@sojanpr
Copy link
Contributor

sojanpr commented Mar 8, 2018

@Amagi82 Thanks for notifying. Agree with you. We are migrating to latest gradle. Will be releasing soon.
(Except one all the dependencies for this SDK are optional though)

@sojanpr
Copy link
Contributor

sojanpr commented Mar 16, 2018

@Amagi82 We have updated the SDK to latest Gradle here 6e52e68
Thanks for helping to make Branch SDK better.

@sojanpr sojanpr closed this as completed Mar 16, 2018
@Mohsankhan3491
Copy link

i face still this issue please guide me

@sojanpr
Copy link
Contributor

sojanpr commented Apr 29, 2018

@Amagi82 Really sorry to hear that. We have updated the gradle to use implementation as you see here
https://github.com/BranchMetrics/android-branch-deep-linking/blob/master/Branch-SDK/build.gradle
Could you please help with the following question to fix this.
How are you integrating Branch to your code? Are you adding compile 'io.branch.sdk.android:library:x.y.z to your project or you fork the repository add add as a project dependency?

@AghaAsadKhan
Copy link

The solution is to upgrade classpath com.google.gms:google-services to classpath 'com.google.gms:google-services:3.2.1' in file in build.gradle Project:

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'

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

}

allprojects {
repositories {
jcenter()
google()
}
}

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

@ycv005
Copy link

ycv005 commented May 31, 2018

Check my answer here at stackoverflow- https://stackoverflow.com/a/50620578/7857541

@sevalyilmaz
Copy link

Right click on the Application folder then "Open Module Settings>Dependencies>Scope" and then sync the project.

@asadmukhtar28
Copy link

I`m still facing the same issue even i replace all compile in build.gradle file to implementation, and even i found that only 1 places compile is written in my project is like this

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.janice.i_training"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

@jrroger
Copy link

jrroger commented Aug 8, 2018

@asadmukhtar28 I have the same problem as you and it started after use the Android studio assistant to connect to a firebase database already created. The connection is correct but I can't find that "compile" anywhere :-( I tried to clean project, rebuilt project and invalidate caches, restarts and did not work

@guther
Copy link

guther commented Aug 31, 2018

@jrroger Check your 'com.google.gms:google-services' in 'build.grandle' file. Check if you are using 'com.google.gms:google-services:3.2.1'

@hatef77
Copy link

hatef77 commented Sep 8, 2018

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
Hi, I have the same problem , plz help me have android 3.1.4 'gradle version 4.4'

'build.grandle'
apply plugin: 'com.android.application'

//apply plugin: 'com.neenbedankt.android-apt'

apply plugin: 'io.fabric'

repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }

}
def RELEASE_STORE_PASSWORD = "?????"
def RELEASE_KEY_ALIAS = "telegram"
def RELEASE_KEY_PASSWORD = "?????"
//def dbflow_version = "3.0.0"
dependencies {

compile 'com.android.support:multidex:1.0.2'

// compile project(':pushe-lib-0.10.2')
// compile 'co.ronash.android:pushe-base:1.1.0'
// compile 'com.onesignal:OneSignal:3.0.3@aar'
compile 'com.onesignal:OneSignal:3.+@aar'
// compile "com.google.android.gms:play-services-location:8.4.0"
//noinspection GradleCompatible
compile 'com.android.support:support-v4:23.+'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
// compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'net.hockeyapp.android:HockeySDK:3.6.+'
compile 'com.googlecode.mp4parser:isoparser:1.0.+'
// compile 'com.android.support:design:22.2.0'
compile 'com.android.support:design:24.+'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/java-jwt-2.1.0.jar')
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'

compile('com.crashlytics.sdk.android:crashlytics:2.6.3@aar') {
    transitive = true;
}
//    apt "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
//    // use kapt for kotlin apt
//    compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
//    compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
compile files('libs/gson-2.2.2.jar')
compile files('libs/adPlayAndroidv2.5.jar')

}

android {
compileSdkVersion 24
buildToolsVersion '27.0.3'
configurations{
all*.exclude module: 'okhttp'
all*.exclude module: 'okio'
}

useLibrary 'org.apache.http.legacy'
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}

signingConfigs {
    debug {
        storeFile file("config/release.keystore.jks")
        storePassword RELEASE_STORE_PASSWORD
        keyAlias RELEASE_KEY_ALIAS
        keyPassword RELEASE_KEY_PASSWORD
    }

    release {
        storeFile file("config/release.keystore.jks")
        storePassword RELEASE_STORE_PASSWORD
        keyAlias RELEASE_KEY_ALIAS
        keyPassword RELEASE_KEY_PASSWORD
    }
}

buildTypes {
    debug {
        debuggable true
        jniDebuggable true
        signingConfig signingConfigs.debug

// applicationIdSuffix ".beta"
}

dexOptions{

    javaMaxHeapSize"4g"
}

    release {
        debuggable true
        jniDebuggable false
        signingConfig signingConfigs.release
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    foss {
        debuggable false
        jniDebuggable false
        signingConfig signingConfigs.release
    }
}

// defaultConfig.versionCode = 787

sourceSets.main {
    jniLibs.srcDir 'libs'
    jni.srcDirs = [] //disable automatic ndk-build call
    //jni.srcDirs = 'jni'
}

sourceSets.debug {
    manifest.srcFile 'config/debug/AndroidManifest.xml'
}

sourceSets.release {
    manifest.srcFile 'config/release/AndroidManifest.xml'
}

sourceSets.foss {
    manifest.srcFile 'config/foss/AndroidManifest.xml'
}

// productFlavors {
// x86 {
// ndk {
// abiFilter "x86"
// }
// versionCode = 2
// }
// arm {
// ndk {
// abiFilter "armeabi"
// }
// versionCode = 0
// }
// armv7 {
// ndk {
// abiFilter "armeabi-v7a"
// }
// versionCode = 1
// }
// fat {
// versionCode = 3
// }
// }

applicationVariants.all { variant ->
    def abiVersion = 0
    //variant.productFlavors.get(0).versionCode
    variant.mergedFlavor.versionCode = defaultConfig.versionCode * 10 + abiVersion;
}

defaultConfig {
    applicationId = "com.add.??????"
    minSdkVersion 15
    targetSdkVersion 24
    versionName "2.3"
    multiDexEnabled true
    manifestPlaceholders = [/*mnifestApplicationId: "${applicationId}",*/
                            onesignal_app_id: "AIzaSyDwRzpXKKKiPHMVipHaeYYnuDtbmN6Yh5c",
                            onesignal_google_project_number: "552070056172"]
}
defaultConfig.versionCode = 141

}

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

@fgb3420
Copy link

fgb3420 commented Sep 20, 2018

@jrroger Check your 'com.google.gms:google-services' in 'build.grandle' file. Check if you are using 'com.google.gms:google-services:
Thanks,I have the same problem and your solution help me.

@hatef77
Copy link

hatef77 commented Sep 20, 2018

yes, I have,
apply plugin: 'com.google.gms.google-services'
/////////////////////
but I'm back to 2.3.3 ,
but now have this problem
android studio 2.3.3.txt

@ghost
Copy link

ghost commented Oct 22, 2018

Hi!

You just need to change the 'compile' by 'implementation' in the 'Build.Gradle' on module app.

@SagarGiri2104
Copy link

enter image description here

Explaination:

since the compile is been obsolete in 2018 you must change this configuration as follows:

  1. open build.gradle(module:app) app file and make following changes in it.
  2. replace compile with api wherever api ref. like: volley, GitHub dependancy.strong text is used and
  3. replace compile with implementation incase of using android libraries like play-services-maps,appcompat-v7 etc.

example:
old way

  dependencies {
     testCompile'junit:junit:4.12'
    compile 'com.android.volley:volley:1.1.0' 

Change it to:

 dependencies {
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.volley:volley:1.1.0'

if the issue still persists:

open build.gradle (Project: yourproject) file
and change the google gms services to the latest

dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

Also if the gradle sync is still failing:

Open gradle-wrapper.properties file and replace it with following:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

@eddskt
Copy link

eddskt commented Jun 17, 2019

The solution is to upgrade classpath com.google.gms:google-services to classpath 'com.google.gms:google-services:3.2.1' in file in build.gradle Project:

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'

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

}

allprojects {
repositories {
jcenter()
google()
}
}

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

I dont know if this is a good solution, because i have dependencie with classpath 3.3.0 in the project and I continue with the problem.

classpath 'com.android.tools.build:gradle:3.3.0'

@sumansanohub
Copy link

Hi,
I have changed my app platform from 7.1.2 to 8.1.0 after that I'm not able to build my app.

Getting the following Error...

Configure project :app
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

FAILURE: Build failed with an exception.

  • Where:
    Script '/home/rohit/Sanohub/Exprement/Patient/Sep_18_2019/sameApp/sanoSense3-v2.5.0/platforms/android/cordova-support-google-services/sanosense-build.gradle' line: 16

  • What went wrong:
    A problem occurred evaluating project ':app'.

Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
For input string: "+"

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Please help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests