3

When i was add object plugIn It will show this warning..Any one know how should I solve this. Its bothering me at every time

WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace. Affected Modules: app

Nimantha
  • 165
  • 3
  • 11

4 Answers4

1

I have this problem too but this is just a warning although it's a red message, and it's going to be fixed with plugin updates, you should not worry about it.

But if it's bothering you, you can downgrade your Gradle version to 3.2.0 and it will be disappeared. (I'm not sure about Gradle version but if 3.2.0 doesn't help you, try other versions).

Omid Behrouzi
  • 101
  • 1
  • 7
1

As the message indicates it is a warning that can be safely ignored until you update to versions of Android Gradle Plugin beyond 3.3.0.

We are aware of this and a future update will use the new instead of the deprecated Android Gradle Plugin API.

https://github.com/objectbox/objectbox-java/issues/643

Uwe - ObjectBox
  • 1,012
  • 1
  • 7
  • 11
1

This has been fixed in the latest release of the Fabric gradle plugin, 1.28.0. Have this in your top-level build.gradle:

buildscript {
  // ... repositories, etc. ...

   dependencies {
       // ...other dependencies ...
       classpath 'io.fabric.tools:gradle:1.28.0'
   }
}
Masum
  • 1,037
  • 15
  • 32
-1

For my case, i used variant.javaCompile() in my gradle, change it to variant.javaCompileProvider(), and then the problem was solved.

So you can try to change variant.javaCompile() to variant.javaCompileProvider() in your code.

Or check the gradle plugin you used, for example Fabric.

Shawn Wong
  • 554
  • 6
  • 15