1

In Android Studio version 3.1 dependencies compile word is replaced to implementation. dependencies with Warning in android studio 3.1:

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'
ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
vinod yadav
  • 526
  • 10
  • 21

4 Answers4

0
 buildTypes {
        release {
//            shrinkResources true
//            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
        }
    }

comment shrinkResources true and minifyEnabled true it is working for me

Hemant Sharma
  • 259
  • 5
  • 14
0

As the error states, you have to replace compile with implementation in dependencies since compile is obsolete.

Please check here for example.

alfredmack
  • 103
  • 1
  • 12
0

The warning is because since Gradle 3.4 (Android Studio 3.1 is using Gradle >= 4.6) is introducing new configurations:

Gradle 3.4 introduced new Java Library plugin configurations that allow you to control whether a dependency is published to the compile and runtime classpaths of projects that consume that library. The Android plugin is adopting these new dependency configurations, and migrating large projects to use them can drastically reduce build times. The following table helps you understand which configurations you should use.

As the warning says, the compile configuration will be removed from gradle at the end of 2018.

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
0

replace all the 'compile's with 'implementation' in the (Module:app) (in your code it looks like this ) :

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'

SyntaxNavigator
  • 312
  • 3
  • 10