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
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
Comments
Okay so I managed to fix the error by adding this snippet of code like so subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
if (details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx') ) {
details.useVersion "1.0.1"
}
}
}
} Paste this into your buildscript {
ext.kotlin_version = '1.2.51'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
if (details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx') ) {
details.useVersion "1.0.1"
}
}
}
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
} |
I pasted the following dark magic into subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'androidx.core' &&
!details.requested.name.contains('androidx')) {
details.useVersion "1.0.1"
}
}
}
} |
I'm having trouble reproducing this so far. If anyone has sharable code that triggers this error it would be really helpful for debugging. |
I use Hixie's function.and the problem go away |
Still does not work after all the suggestions |
No joke, I recently had the same problem (and I was getting many complaints about various dependencies that were AndroidX, with I solved it by upgrading my gradle dependency in the |
@david-mccoy Thanks ! It worked for me! |
Thankx worked for me
…On Mon, Mar 4, 2019, 9:34 AM Prakhar Varshney ***@***.***> wrote:
@david-mccoy <https://github.com/david-mccoy> Thanks ! It worked for me!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27254 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AX2WfqRQkKG5VGc-8xt1c1vIQhwBzHBKks5vTNqOgaJpZM4aYzDb>
.
|
@david-mccoy great solution works for me! Thanks! |
@david-mccoy great answer. Annoying androidX issues have been bothering me lately and this worked for me |
this worked for me too |
Worked for me after changing also the Kotlin version (I have Kotlin support on my project) to 1.3.0 (I had 1.2.71) |
If gradle upgrade from 3.2.1 to 3.3.1, I found a problem that the android:label in androidmanifest.xml will not take effect after modified and meta-data will not take effect. @david-mccoy. Have you found this problem? |
Sorry, I have not dealt with this problem |
Worked for me. Thanks. |
Bumping Since this is a file that was generated by |
If you have kotlin support in your flutter app, to solve this problem, you need to change 2 values in android/build.gradle:
as at 2019/03/28. |
Hi @bdairy I was having the same issue.
android.useAndroidX = true
|
@sedhha my friend,, All what you've mentioned caused the same problem,, the main issue is that Kotlin version update is not affecting the build... Now if any one has a solution for that please help I am really Stuck without any clarification of the issue... |
@blasten any update on this issue>? is there any hot fix? anything . I can do,, it has been more than 6 days,, please guys |
Just for the reference the problem was with a plugin that is called flutter_launch.. which no one notice in the error including me because the package name also miss leading,, anyway... I had to go the plugin and update the Kotlin version over there to fix the issue,, Thanks for the help everybody. |
@bdairy sorry for not replying earlier. The problem is in the |
@csells How will this be handled in future? I ran today into this after upgrading flutter and my plugins. At least we should find better error messages that tells the user what to do OR even better make flutter doctor to be able to fix such things |
The resolution of this problem involves finding plugin versions that satisfy the version constraints of each supported platform. When pub resolves a dependency, it doesn’t have knowledge of platform dependencies such as the Kotlin version used in a plugin. That said, error messages can be improved. We can highlight the specific plugin that is having issues. Currently, you get a Gradle error, which refers to a plugin as project. |
follow these steps step #2
step #3 step #4 step #5 |
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. |
thanks,for this ,it works for me |
works for me perfectly |
work for me |
One of the Best Github Issue Discussion I have ever seen |
#27254 (comment) |
Running into this issue again after updating cloud_firestore from 0.13.5 to 0.14.0+2. |
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? |
Thanks! It worked for me! |
Adding this line to upgrade android tools in the |
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 |
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.
Here is some more information on the issue
The text was updated successfully, but these errors were encountered: