I just updated Android Studio and I received several warnings saying that the following settings had changed:
-
compile
-
provided
-
apk
The warning messages were like this:
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: link
After reading what this link says , I corrected (or so I think) my file gradle
in the following way:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
defaultConfig {
applicationId "org.deiverbum.liturgiacatolica"
minSdkVersion 21
targetSdkVersion 26
versionName '1.3 (beta)'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
versionCode 1
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
transitive = true
}
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.google.android:flexbox:0.2.5'
implementation 'com.google.android:flexbox:0.3.0-alpha1'
implementation 'com.google.firebase:firebase-invites:11.8.0'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
After updating the file, the app compiles without errors and almost all the warnings disappeared, except one:
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
The warning sends me to the file build.gradle
of the folder app
(the one I've shared above). As you can see, I have changed all compile
by implementation
. Currently, the word compile appears only here: compileSdkVersion 26
... I have tried to change it to implementationSdkVersion 26
and% apiSdkVersion 26
. In both cases it gives an error.
As I said, the app works, but I always have that annoying warning and I would like to know what should be done to remove it.