Warning: API 'Variant.Getjavacompile()' Is Obsolete and Has Been Replaced with 'Variant.Getjavacompileprovider()'

WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'

This issue is fixed now with update Fabric Gradle version 1.30.0:

Update release: March 19, 2019

Please see this Link: https://docs.fabric.io/android/changelog.html#march-15-2019

Please update your classpath dependency in project level Gradle:

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

dependencies {
// ...other dependencies ...
classpath 'io.fabric.tools:gradle:1.30.0'
}
}

API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'. It will be removed at the end of 2019

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'
}
}

API 'variant.getJavaCompile()' is obsolete

Update: It seems like this is a bug in kotlin plugins which mentioned in here

However, using new release of kotlin plugin (When kotlin started using the new APIs) might get rid of the error as stated in here:

https://github.com/JetBrains/kotlin/pull/1884/commits/1a17cb54a775ab3e55db66109cb12b7d54fbba6c

And: https://github.com/JetBrains/kotlin/pull/1884

The commit was actually for the fix of this issue:

This commit does not change anything functionally, it is only to avoid
the warning message
, as reporter in
https://issuetracker.google.com/116198439


After a deep search into codes, seems like getJavaCompile() is obsolete in your current gradle (alpha11 version). However, you were using alpha version of gradle which I don't really recommend that.

Instead, try using the stable versions like:

classpath 'com.android.tools.build:gradle:3.1.4'

And then warning should be gone I hope.

API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'

All those failures I had was because I did things wrong when I followed the steps in the Flutter doc.

Finally I found a YouTube video of MTECHVIRAL, and just by doing what he did, I got a apk file which I could upload. For other flutterfriends who got the same error, try this first. Save you a lot of time and frustrations:

https://www.youtube.com/watch?v=nGvPNG-f1-o

Watch out: in the sentence with the key he makes a typo: 1000 which has to be 10000. So copy and past the sentence of the flutter instruction page.

WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'

If you debug, it shows
REASON: The Kotlin plugin is currently calling this API. We are working to solve this.

To see this error please run
./gradlew -Pandroid.debug.obsoleteApi=true --stacktrace

WARNING: API 'variant.getMappingFile()' is obsolete and has been replaced with 'variant.getMappingFileProvider()'

When running the gradle script with the parameter -Pandroid.debug.obsoleteApi=true set, you can get a stack trace of what is causing the issue.

I found out it in my case was related to Crashlytics. There was this issue opened, but it's apparently the legacy-plugin so the issue has been closed again with a suggestion of contacting the Fabric support. So hopefully they will find a solution.

API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'

The Android Gradle plugin utilizes Task Providers and deprecated all direct task accesses. One such direct access is variant.getAssemble(). From your stacktrace it seems that the Gradle Play Publisher plugin is calling this API, but since the current version of the plugin is not written in Groovy anymore and already uses assembleProvider you should really update it!

API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'

Two versions of the Google Services Gradle Plugin (4.3.0 & 4.3.1) are causing this, upgrading the version to 4.3.2 seems to solve the issue;


In your project-level build.gradle file, under buildscript -> dependencies, check whether you have this line

classpath 'com.google.gms:google-services:4.3.x'

if so, change it to

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

Edit: Click here to check the newest version. (4.3.3) at time of Edit.



Related Topics



Leave a reply



Submit