API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()

橙三吉。 提交于 2019-11-27 10:01:55
0xAliHn

The issue has been fixed in their latest release 'io.fabric.tools:gradle:1.30.0'

Please update your both gradle fabric tools with 1.30.0

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

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

For more details https://github.com/firebase/firebase-android-sdk/issues/198#issuecomment-473435453

EDIT

This issue has been fixed in Fabric 1.28.0. In your build.gradle of the project level, add the following line:

classpath 'io.fabric.tools:gradle:1.28.1'

Previous Answer

It happens after I updated Android Studio to 3.3.0. apply plugin: 'io.fabric' is the cause. I have sent a bug report to Firebase team about this issue.

You have 3 options:

  • Wait until the next version of Fabric plugin is released. Check the latest version here.

  • Downgrade to Android Studio 3.2.1.

  • Comment out io.fabric plugin.

In build.gradle of your app's module:

apply plugin: 'com.android.application'
// apply plugin: 'io.fabric' <== this plugin causes the error

However, you can still build and run your projects even though this error appears. Just ignore it.

in application build.gradle , downgrade to this stable version of gradle :

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

It happens after I updated Android Studio to 3.3 , temp solution until they fix it !

edit: you don't need to downgrade your android studio !

UPDATE As of today you can use classpath 'io.fabric.tools:gradle:1.28.0' to fix this issue !

If commenting out Crashlytics's plugin io.fabric on the app gradle file worked for you temporarily

//apply plugin: 'io.fabric'

Then upgrading your fabric gradle dependencies on the Project gradle file will permanently solve the issue:

classpath 'io.fabric.tools:gradle:1.27.0'

NB: this doesn’t remove the warnings but let you use Crashlytics with AS3.3+

Not sure what the actual issue is but commenting out the crashlytics related dependencies from the project solved issue.

It's confirmed as bug for Crashlytics and they are working on it.

https://issuetracker.google.com/issues/116408637

Quoted from Google assignee:

je...@google.com #23 Jan 23, 2019 01:40AM
Hi all,

Thank you for your patience.

It looks like the bug in all cases is coming from crashlytics and I've filed a bug with them.

I will keep you updated on the status.

For me, my debug app is working fine on my device just by running and ignoring the warning without commenting Crashlytics or Fabric. I have not try for production.

Update:

Google Issue Tracker had mark this issues as Won't Fix (Infeasible) because all the issues was from Crashlytics, and let fixes done by Crashlytics team (despite they are same Googler...).

They suggest to follow this link for Crashlytics updates:

https://github.com/firebase/firebase-android-sdk/issues/198

Note: I'm still using Android Studio 3.3 with io.fabric.tools:gradle:1.26.0 without commenting any of Craslytics and it's works fine on my debug app.

Update:

I can confirm now that it works fine on my production/release version app. How do I know it works? Because it had sent me back a crash reports -_-'

Anyway, just ignore the warning, they should fix it eventually.

Aww, just read that it had fixed with fabric 1.28.0 :)

Latest news from 01/24/2019

Info here https://issuetracker.google.com/issues/116408637

We will need to wait untill Crashlytics came up with a solution, here is GitHub issue opened

https://github.com/firebase/firebase-android-sdk/issues/198

The only way I'm using as right now to not comment io.fabric plugin is downgrading my gradle and upgrading my fabric classpath (this is working on my production app)

 dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'io.fabric.tools:gradle:1.27.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

As it was said, the problem is with Fabric/Crashlytics.

apply plugin: 'io.fabric'

It's a bug on Crashlytics/Firebase side, please check the following link and see the bug' status : https://github.com/firebase/firebase-android-sdk/issues/198

the issue-tracker might refer to "lazy task configuration" -

that's at least what task configuration avoidance suggests.

but one possibly can prevent the access to this obsolete method of BaseVariantImpl, when variant.outputs.all won't access that method (internally) - or when checks can prevent the access; or when accessing the variant by it's name; or somehow disable the external native build tasks for the variant. also see the single-variant project sync option, which rather seems related.

or wait for build-tools 3.3.0-alpha12 or 3.3.0-beta1 ...this is not even a release candidate, therefore investing to much time might be pointless - except using it to file another bug-report.

the new quick feedback

button still looks the most promising.

Rahul Kushwaha

This happens due to the update of your Android Studio from Android Studio 3.2.0 to Android Studio 3.3.0. Update Your Gradle Dependencies (Project)of IO.Fabric. Like:

classpath 'io.fabric.tools:gradle:1.27.1'

and also update your Kotlin version to

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20"

This will resolve this issues. Thanks

For me, I followed these steps: 1. upgrade the Gradle dependency on project level build.gradle.

        classpath 'io.fabric.tools:gradle:1.28.0'
  1. add this plugin dependency below apply plugin: 'com.android.application' in the app level build.gradle.

        apply plugin: 'io.fabric'
    
  2. Sync the project with gradle files.

Build log prints how to debug this, particularly you need to run build with -Pandroid.debug.obsoleteApi=true, that'll print stack-trace of call to deprecated API and you'll be able to figure which plugin/code calls it.

If it ends up being your code — use new Provider API (read Lazy Task Configuration doc)

If it comes from other plugin — report to them with stack-trace and warning message and maybe submit a patch. As in this case its related to io.fabric issue.

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

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

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

When I opened the project, I pressed the Run migrations button appeared on the right bottom corner from Android Studio. A migration was performed and the problem was solve without commenting out the Crashlytics dependency.

Changing source compatibility in module build.gradle file to Java 8 fixes the issue

compileOptions {
    sourceCompatibility 1.8
    targetCompatibility 1.8
}

Be sure to rebuild the project after adding those lines

this will fix the error : On the taskbar click Tools->Kotlin->Configure Kotlin in Project

In my case, I needed to use io.fabric plugin, and the solution was, to update to the latest fabric tools gradle version:

classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'io.fabric.tools:gradle:1.27.0'

For those who need to keep the Fabric plugin applied, the temporary solution is to go back to the previous version of the gradle at the project level.

Change the classpath version to com.android.tools.build:gradle:3.2.1.

It was a problem with latest gradle (in my case 3.3.2) version and Fabric.io plugin. It is now solved by the new version Users should have this in their top-level build.gradle:

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

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

first of all this is not an error

it's warning

and its show up when update gradle to 3.3.0 Often occur because io.fabric so wait until the update fabric current version where warning is still show up is 'io.fabric.tools:gradle:1.27.1'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!