14

I receive following warning while executing gradle in android:

Configuration 'compile' in project ':app' is deprecated.

But all my dependencies included via implementation configuration. (And modules too) Are there any "invisible" dependencies in gradle?

Here is my main build gradle file: https://pastebin.com/ZJe7zrwn

Valentin Baryshev
  • 2,195
  • 3
  • 15
  • 24

4 Answers4

14

I found this working solution while compiling my code today. (When everything is implementation and nothing is compile in your build.gradle)

Errors:

 1. Configuration 'compile' in project ':app' is deprecated 
 2. registerResGeneratingTask is deprecated, use registerGeneratedFolders (FileCollection)

Solution:

I needed to update my Project: build.gradle

from

classpath 'com.google.gms:google-services:3.1.0'

to

classpath 'com.google.gms:google-services:3.2.0'
Rohit Sharma
  • 1,271
  • 5
  • 19
  • 37
5

Are there any "invisible" dependencies in gradle?

I don't know whether it's responsible for this problem, but plugins can add dependencies, and in particular com.google.gms.google-services does:

The google-services plugin has two main functions: ...

  1. Add dependencies for basic libraries required for the services you have enabled.
Community
  • 1
  • 1
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
4

replace in path ctrl+shift+R

Select project find replace snip

type in "provided" replace with "compileOnly" or replace "compile" with "implementation" make sure your only changing the gradle.build files If you have some angst then just open the gradle.build files and edit them.

gradle snip

danny117
  • 5,581
  • 1
  • 26
  • 35
  • Thanks, indeed what I needed to do was to remove the 'compile' statements and leave only the 'implementation' ones as both compile/testCompile are deprecated – michael_demonio Jan 29 '21 at 13:34
1

I think you received warning because you use,

compileOnly "org.glassfish:javax.annotation:10.0-b28"

a better explanation is given here,

Android Gradle Implementation vs CompileOnly Performance

Kishan Donga
  • 2,851
  • 2
  • 23
  • 35