You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution #27254
I know what this problem means but I don't know how to come up with a solution to this exact one. I've provided code which is a fix to a similar problem I had with the android support libraries.
Launching lib\main.dart on TA 1024 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) 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 6s
Finished with error: Gradle task assembleDebug failed with exit code 1
Reacted by Rody Davis, Bharat Kathi, Lebogang Nkosi, Pearl Takang, Chris Barfod, Dan, woshitom, Lucas, Kimberley I Heuer, Jack Tang and 112 more
Reacted by Omar Sherif, Dang Nguyen Anh Khoa, Shardul Nalegave, ILKIN TACAN, Lukas K Jacomin, Waleed Arshad, Oliver Brunsmann, Furkan Çukur, Renan Coelho, Chamith Chathuka and 2 more
Reacted by Gustavo Andrade, Kasparas Jonas Kizlaitis, nguyendangkhoi and Mohsin
Reacted by AhmetAY, Aleksej Zaicev, Aman Malhotra, Steve. Martis R., Shreyas Rana, igor90007, Balaji K S, Ishaq Hassan, Shardul Nalegave, Shaniel and 12 more
Reacted by Santos Enoque, Lucas Maciel Cordeiro, LinkinStars, madhusudhan-sahani, AhmetAY, Yuris Cakranegara, Rishi Banerjee, Nha Pham, Amin Negahban, Aleksej Zaicev and 31 more
Reacted by ATRI DAS, ranabhawana, Mohammad Fayaz, igor90007, Balaji K S, Ishaq Hassan, Shardul Nalegave, mohammadreza490, Gabriel , Kennedy Nyaga and 10 more
Reacted by Humphrey Daniel, Kasparas Jonas Kizlaitis, Philipp Bauer, nguyendangkhoi, Ollin Magno and govindsa1011
Reacted by czronaldo11, Sherwin, anmolmajhail, Dan, Sylvain Duché, Rafael Roman, Phil Wamba, Aya Elsisy, Joseph Alberto Morthimer León Lau, Umut Seven and 112 more
Reacted by rami965, khalidzhn, vincentquigley, Omar Abdo, Lance-Mao, Meet Patel, Rowin Hernández, Smith Sese , Michael, Muhammad Mateen and 14 more
Reacted by Willian Oliveira, Navinkumar, Mehmet Esen, Michał Dobrzanski, Nishant Goel, Shehan Edirimannage, Sajad Abbasi, Sibasish Pasupalak and Okocha Ebube
Reacted by Navinkumar, José Nobre, Nishant Goel, Sajad Abbasi, giquieu and Sibasish Pasupalak
Reacted by Steve, Ahsan Hameed, Sajad Abbasi and brayan9212010
Reacted by Rami ahmed, Omar Sherif, Aleksa Savić, Pruthivika, pekretsc, Majd Kazmoz, robsondon, M Ubaidillah S, Suhailakl, Mahmoud Mabrok Fouad and 8 more
Reacted by Omar Sherif, Aleksa Savić, Ishaq Hassan, Majd Kazmoz, robsondon, Mattia Arietti, Mahmoud Mabrok Fouad, Navinkumar, zzq, José Nobre and 4 more
No joke, I recently had the same problem (and I was getting many complaints about various dependencies that were AndroidX, with -rc01 version endings), and various solutions for forcing a resolution strategy were not working.
I solved it by upgrading my gradle dependency in the android/build.gradle file: classpath 'com.android.tools.build:gradle:3.3.1' (I was previously on version 3.2.1)
Reacted by Sh1d0w, Ankush Karkar, Prakhar Varshney, Fabio24Silva, vincidezc, skrawczyk, Tommy, rullyalves, Diego Cubissimo Lopes, evanchen2914 and 406 more
Reacted by Louis Chovaneck, foxrobin, tianyu, ThitSarNyan, ILKIN TACAN, kvalda, HENRIQUESOUZ, Nguyễn Hoàng Long, Furkan Çukur, Vinh Shin and 1 more
Reacted by Daan van den Hoek, DigiD3ar, Rohan Gautam, Antti Ahti, kyle, 蹬, Matheus Bueno, Cristiano Fagundes, Sudhansu, Yechenxing and 48 more
Reacted by Tommy, Amsakanna, rullyalves, Diego Cubissimo Lopes, Jean-Charles Moussé, Santiago Salmeron, Daan van den Hoek, DigiD3ar, Rohan Gautam, Gabriel Moreyra and 95 more
Reacted by Zein Ersyad, exponent112, Ishaq Hassan, Sai Gokula Krishnan, Antoniel Carlos Amaral, Nikiforos Pertselis, Andrei Kabylin and Hananto Eko Saputro
Reacted by Tommy, rullyalves, Diego Cubissimo Lopes, Santiago Salmeron, dazza5000, Daan van den Hoek, DigiD3ar, Rohan Gautam, Tom Cervenka, kyle and 96 more
Reacted by Tommy, Amsakanna, rullyalves, Diego Cubissimo Lopes, abhimamk, Santiago Salmeron, Ivan Yordanov, Daan van den Hoek, Rohan Gautam, kyle and 85 more
Reacted by Rafael Roman, kyle, Teng Keng Shen, Sudhansu, Leonardo Cardoso, ChrisPei, Stephan Cassel, Ik, yony salgado, Doto and 19 more
I'm closing this bug as the original issue was caused by combining AndroidX and support dependencies. The AndroidX migration guide walks through the steps to avoid this problem: https://flutter.dev/docs/development/androidx-migration.
No joke, I recently had the same problem (and I was getting many complaints about various dependencies that were AndroidX, with -rc01 version endings), and various solutions for forcing a resolution strategy were not working.
I solved it by upgrading my gradle dependency in the android/build.gradle file: classpath 'com.android.tools.build:gradle:3.3.1' (I was previously on version 3.2.1)
Adding this line to upgrade android tools in the dependency section in android/build.gradle solved it for me: classpath 'com.android.tools.build:gradle:3.5.1'
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, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Lebogang95 commentedon Jan 29, 2019
Okay so I managed to fix the error by adding this snippet of code like so
Paste this into your
build.gradleunder build script like so.Hixie commentedon Feb 8, 2019
cc @amirh @mklim
After upgrading the
compileSdkVersionfrom 27 to 28 on my app, I got this error.Hixie commentedon Feb 8, 2019
I pasted the following dark magic into
.../android/build.gradle(not.../android/app/build.grade) and that made the problem go away:subprojects { project.configurations.all { resolutionStrategy.eachDependency { details -> if (details.requested.group == 'androidx.core' && !details.requested.name.contains('androidx')) { details.useVersion "1.0.1" } } } }mklim commentedon Feb 8, 2019
I'm having trouble reproducing this so far. If anyone has sharable code that triggers this error it would be really helpful for debugging.
mklim commentedon Feb 14, 2019
@Atominac found a reproducible case in #27679.
czronaldo11 commentedon Feb 19, 2019
I use Hixie's function.and the problem go away
Boxerbuzz commentedon Feb 28, 2019
Still does not work after all the suggestions
david-shortman commentedon Mar 1, 2019
No joke, I recently had the same problem (and I was getting many complaints about various dependencies that were AndroidX, with
-rc01version endings), and various solutions for forcing a resolution strategy were not working.I solved it by upgrading my gradle dependency in the
android/build.gradlefile:classpath 'com.android.tools.build:gradle:3.3.1'(I was previously on version3.2.1)83 remaining items
blasten commentedon Apr 10, 2020
I'm closing this bug as the original issue was caused by combining AndroidX and support dependencies. The AndroidX migration guide walks through the steps to avoid this problem: https://flutter.dev/docs/development/androidx-migration.
maoyujiao commentedon Apr 24, 2020
thanks,for this ,it works for me
4tKnight commentedon May 8, 2020
works for me perfectly
Yuliang-Lee commentedon Jun 3, 2020
work for me
Shivam-Shrivastav commentedon Jul 28, 2020
One of the Best Github Issue Discussion I have ever seen
ShamshadSani commentedon Aug 7, 2020
#27254 (comment)
solved my isssue
Bryanx commentedon Aug 24, 2020
Running into this issue again after updating cloud_firestore from 0.13.5 to 0.14.0+2.
joelbrostrom commentedon Sep 24, 2020
Worked for me as well.
This is what it looks like in the build.gradle file:
Is there a way to let flutter do this change when a package that relies on it is being updated/added?
z234009184 commentedon Oct 13, 2020
Thanks! It worked for me!
m-jabrane commentedon Jan 8, 2021
@Bryanx I have the same issue with
cloud_firestore: ^0.14.3+1, have you found a solution or a workaround ?Update:
756990464
theblueskies commentedon Jun 21, 2021
Adding this line to upgrade android tools in the
dependencysection in android/build.gradle solved it for me:classpath 'com.android.tools.build:gradle:3.5.1'github-actions commentedon Jul 31, 2021
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, including the output of
flutter doctor -vand a minimal reproduction of the issue.