Android Studio build.gradle installation warning

After I successfully upgraded to Android Studio 3.1 Canary 9, I get a warning message like

Warning:Configuration 'compile' is obsolete and has been replaced with 'implementation'. It will be removed at the end of 2018 

I know that this warning will not cause any problems in my project at least for now. But I want to completely remove it so that there are no problems in the future. But after looking at my build.gradle file, I cannot find the line of code that generally raised this warning.

Here is my build.gradle file

 apply plugin: 'com.android.application' android { compileSdkVersion 27 defaultConfig { applicationId "app.project.virtualdiary" minSdkVersion 21 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' } } } dependencies { implementation 'com.google.firebase:firebase-auth:11.8.0' implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:27.0.2' implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' implementation 'com.android.support:support-v4:27.0.2' implementation 'com.android.support:support-vector-drawable:27.0.2' } apply plugin: 'com.google.gms.google-services' 
+37
source share
6 answers

The problem is apply plugin: 'com.google.gms.google-services'

The Google Services plugin adds dependency to you. Hope they fix it in the future.

+48
source

I have the same warning caused by com.google.gms: google-services.

Solution: update classpath com.google.gms: google-services to classpath 'com.google.gms: google-services: 3.2.0' in the file in build.gradle Project:

enter image description here

 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.0' } } allprojects { repositories { jcenter() google() } } task clean(type: Delete) { delete rootProject.buildDir } 

In the submenu of version 3.1 of version 7.5 for Android Studio is replaced by an implementation

with warning in android 3.0 studio

 dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:27.1.0' compile 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' } 

OK dependencies in Android 3.0 studio

  dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:27.1.0' implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' } 

Gradel is generating Android Studio 3.1 for a new project.

Gradel generate by Android Studio 3.1 for new project.

Visit https://docs.gradle.org/current/userguide/dependency_management_for_java_projects.html

Read more https://docs.gradle.org/current/userguide/declaring_dependencies.html

Good luck.

+13
source

first select:

  • Create
  • Clean up the project and build
  • make a project in android studio
+5
source

When the package name AndroidManifest.xml is different from the package name build.gradle, I get this error

The compilation configuration is deprecated and replaced by an 'implementation'. It will be removed at the end of 2018.

Java compilation error

0
source

Change “compilation” to “implementation”. this problem will be fixed! It works on my computer.

-3
source

implementationConfiguration "compilation" is deprecated and replaced by "implementation". It will be removed at the end of 2018.

-6
source

Source: https://habr.com/ru/post/1276156/


All Articles