Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility #223

Closed
akaytatsu opened this issue Dec 12, 2019 · 42 comments

Comments

@akaytatsu
Copy link

After flutter upgrade, the project not building.

Environment

Flutter 1.12.13+hotfix.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 27321ebbad (2 days ago) • 2019-12-10 18:15:01 -0800
Engine • revision 2994f7e1e6
Tools • Dart 2.7.0

Flutter version:
**Plugin version: "2.1.0+1"
Android version:
iOS version:
Xcode version:
Device information:

Description

Expected behavior:

Current behavior:

Steps to reproduce

Just try build.

Images

image

LOG:

Launching lib\main.dart on Android SDK built for x86 in debug mode...

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:preDebugBuild'.

Android dependency 'androidx.loader:loader' has different version for the compile (1.0.0-rc01) and runtime (1.0.0) classpath. You should manually set the same version via DependencyResolution

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 23s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin flutter_inappwebview...
The plugin flutter_inappwebview could not be built due to the issue above.
Exited (sigterm)

@akaytatsu
Copy link
Author

Updating,

After create new project with command "flutter create --androidx {name}" and copy pubspec.yaml, assets (folder) and lib (folder) to new project, the build it's success.

@pichillilorenzo
Copy link
Owner

@akaytatsu yes, it requires androidx! Ok!

@dmvasheka
Copy link

I faced the same isuue, but the proposed solution did not help me

@Chethansmash7
Copy link

Updating,

After create new project with command "flutter create --androidx {name}" and copy pubspec.yaml, assets (folder) and lib (folder) to new project, the build it's success.

Could you please elaborate the solution?

flutter create --androidx {name} :what exactly name should be?

@arnaudelub
Copy link

@Chethansmash7 you don't need to add --androidX anymore as it's the default now.
{name} is the actual name of the app you want to create, i.e: flutter create myapp

@Chethansmash7
Copy link

I faced the same isuue, but the proposed solution did not help me

Yeah,even for me

@Chethansmash7
Copy link

@Chethansmash7 you don't need to add --androidX anymore as it's the default now.
{name} is the actual name of the app you want to create, i.e: flutter create myapp

But still I am facing the same issue

@kleviss
Copy link

kleviss commented May 4, 2020

flutter create --androidx {name}

This has worked for me every time I had this problem. Just create a new app from the terminal with the command above and paste the lib dir and pubspec.yaml into your just created app and you should be good to go. For some weird reason my project was not running after some time but this solves the issue.

Commeting to prove that this works as of May 2020

@HacktorDevelopers
Copy link

My app is androidX compatible, but i still face the issue...

@pichillilorenzo
Copy link
Owner

If you still have this error, upgrade your Flutter version and try to create a new fresh Flutter app and add only just this plugin as your dependency.
Then, try the very quick and easy example available in the README.md.

If the example works, then your Flutter App has some other issues that, probably, it's not related to this plugin (because this plugin is already AndroidX compatible).
Maybe your app isn't AndroidX 100% compatible for some other reasons or, maybe, there are other plugins that aren't AndroidX compatible! Check the version of all your dependencies, and, in case, consider upgrading the version you are using.

In that case, the solution given by @kleviss should work.

@ali80
Copy link

ali80 commented Jun 21, 2020

This issue still persists after updating to 1.17.4
used flutter clean and also deleted the build folder and .dart_tool folder
that fixed it for me

This was referenced Jul 6, 2020
@faizan1947
Copy link

BUILD FAILED in 2m 15s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 136.8s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin clipboard_manager...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 7.3s
√ Built build\app\outputs\repo.
Building plugin cloud_firestore...
The plugin cloud_firestore could not be built due to the issue above.

@saigkl
Copy link

saigkl commented Sep 2, 2020

I too face the same issue as @Faizi-Apps. Any luck in resolving this?

@anilpandey071999
Copy link

I faced the same issue, but the above-given solution did not help me
Screenshot (121)

@kamleshwebtech
Copy link

any perfect solution ??

@KOSNOWMAN
Copy link

In my case, I removed the package "flutter_facebook_login: ^3.0.0" in pubspen.yaml file then it run well...
What's the matter?

@nvrr
Copy link

nvrr commented Nov 19, 2020

if you have any packages like facebook_login,github, twitter remove them, firebase_auth is enough.
another problem may be you not migrate to AndroidX correctly.

@faizan1947
Copy link

I too face the same issue as @Faizi-Apps. Any luck in resolving this?

i was using a some share package , i don't know the exact name ..when i remove then it works fine

@muhammednazil
Copy link

The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.

any good solution for this

@PrinceGoyal
Copy link

PrinceGoyal commented Jan 6, 2021

Try adding this line In your Project folder > android > app > build.gradle:
defaultConfig {
multiDexEnabled true
}

@muhammednazil
Copy link

muhammednazil commented Jan 6, 2021 via email

@markwitt1
Copy link

I am facing the same issue on a newly created Flutter app

@Rajat130
Copy link

May be, this is due to the pubspec.yaml file in which if you remove any specific plugin it may happen.
But you can prevent this error from your plugin.
Remember that if you added any piece of code in either AndroidManifest.xml or info.plist while installing any plugin which makes it incompatible or showing an error while running your app in debug mode.

@manarshawkey
Copy link

I ran 'flutter clean' and it solved my problem.
I had the following:
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin flutter_local_notifications...
Running Gradle task 'assembleAarRelease'...

@tiklup11
Copy link

Any update please???

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
C:\Users\tiklu.gradle\caches\transforms-2\files-2.1\5324cf3d856f90a58788658b9d99824d\play-services-ads-lite-19.6.0\AndroidManifest.xml:27:5-38:15: AAPT: error: unexpected element found in .

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 14s
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
Building plugin cloud_firestore...
Running Gradle task 'assembleAarRelease'...
Exception: The plugin cloud_firestore could not be built due to the issue above.

@abdullah4one
Copy link

abdullah4one commented Feb 17, 2021

Any update please???

Run flutter build appbundle --obfuscate --split-debug-info=build/app/outputs/bundle/release/ --release --no-tree-shake-icons
Running Gradle task 'bundleRelease'...                          
Note: /opt/hostedtoolcache/flutter/1.22.2-stable/x64/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.7.0/android/src/main/java/io/flutter/plugins/firebase/core/FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.
Note: /opt/hostedtoolcache/flutter/1.22.2-stable/x64/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0/android/src/main/java/io/flutter/plugins/firebase/firestore/streamhandler/TransactionStreamHandler.java uses unchecked or unsafe operations.


Note: Recompile with -Xlint:unchecked for details.




warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
error: warnings found and -Werror specified



FAILURE: Build failed with an exception.



* What went wrong:

Execution failed for task ':connectivity:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.




* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6m 0s




Running Gradle task 'bundleRelease'...                            361.2s (!)
Gradle task bundleRelease failed with exit code 1
Error: Process completed with exit code 1.

@seabass123
Copy link

@tiklup11 had the same issue. no success with flutter clean, multidex is enabled, app is androidx compatible and removed C:\Users\<user>\.gradle\caches

what worked for me

  • close all programs
  • remove C:\Users\<user>\AppData\Local\Temp (not sure which folder inside was exactly responsible, in case you need to keep any temp files for other programs better move the folder somewhere else to be able to restore data if needed)
  • i opened the project in Android Studio and it started (re)download a bunch of packages right away -> build successfull
  • start app without issues

@tiklup11
Copy link

@seabass123 thanks man but didn't work for me. As soon as I install firebase_admob, i am getting these error. Also errors mention that all firebase packages [firestore_cloud, auth, core] use or override a deprecated API. Those all are latest packages and I am using latest version of flutter.

@Pablo-hub44
Copy link

me pasa lo mismo que a ti tiklup11 , encontraste una solucion?

@Pablo-hub44
Copy link

image

@pichillilorenzo
Copy link
Owner

Please stop spamming here problems related to other plugins.
If you have problems with another plugin, post the issue to the corresponding plugin repository and not here.
As I said, my plugin is already AndroidX compatible.

@Pablo-hub44
Copy link

alguien sabe como solucionar el error que tengo?

@tiklup11
Copy link

tiklup11 commented Mar 4, 2021

alguien sabe como solucionar el error que tengo?

I did change to this in my android/build.gradle---

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

@thealmamun
Copy link

alguien sabe como solucionar el error que tengo?

I did change to this in my android/build.gradle---

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

I have added above classpath, then run 1. flutter clean, 2. flutter pub get, 3. flutter create . 4. flutter doctor -v 5. flutter run

@muhibbin-munna
Copy link

alguien sabe como solucionar el error que tengo?

I did change to this in my android/build.gradle---

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

Saved my day, thanks brother

@rayudutejesh
Copy link

rayudutejesh commented Apr 30, 2021

@mrhmamun can you paste the outcomes of 5 steps you mentioned please

@thealmamun
Copy link

thealmamun commented May 9, 2021

@mrhmamun can you paste the outcomes of 5 steps you mentioned please

after adding classpath rest commands run on cmd

@naveed9999
Copy link

alguien sabe como solucionar el error que tengo?

I did change to this in my android/build.gradle---

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

This solved my issue

@deepersolids
Copy link

alguien sabe como solucionar el error que tengo?

I did change to this in my android/build.gradle---
classpath 'com.android.tools.build:gradle:3.5.4'

This solved my issue

this soved my issue.. thanks @naveed9999

@Bader-Al
Copy link

alguien sabe como solucionar el error que tengo?

I did change to this in my android/build.gradle---

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

A similar solution worked for me. Add
implementation "com.android.support:multidex:1.0.3"

under dependencies instead of classpath.

@harshkumarkhatri
Copy link

alguien sabe como solucionar el error que tengo?

I did change to this in my android/build.gradle---
classpath 'com.android.tools.build:gradle:3.5.4'

I have added above classpath, then run 1. flutter clean, 2. flutter pub get, 3. flutter create . 4. flutter doctor -v 5. flutter run

The build command still fails after doing all the things mentioned

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests