Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuration 'compile' in is deprecated, but all configurations are 'implementation'

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

like image 211
Valentin Baryshev Avatar asked Nov 15 '17 06:11

Valentin Baryshev


People also ask

What is the difference between implementation and compile in gradle?

Fortunately, the implementation dependency configuration provides the same functionality as compile. You should always use implementation rather than compile for dependencies, as compile is now deprecated or removed in the case of Gradle 7+.

Is compileOnly deprecated?

compileOnly is the replacement — the equivalent configuration that is being deprecated is provided .

What is difference between compile and compileOnly gradle?

The compileOnly configuration is used to itemize a dependency that you need to compile your code, same as compile above. The difference is that packages your java code use from a compileOnly dependency will not be listed as Import-Package manifest entries.


2 Answers

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'
like image 199
Rohit Sharma Avatar answered Oct 05 '22 11:10

Rohit Sharma


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.
like image 30
Alexey Romanov Avatar answered Oct 05 '22 11:10

Alexey Romanov