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
'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.0.1) classpath #14020
Comments
I solved by adding resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
} to subprojects section in android/build.gradle file |
is like this buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
} |
This worked for me.Thank you. |
i'am sorry i cannot remember why this happened, i think that this error is due when you migrate a project from an older version (e.g 2.0.1) to a newest (e.g 3.0.1) also you need to make sure you have downloaded the appropiated dependencies. check this to get more info. https://stackoverflow.com/questions/47448502/could-not-resolve-com-android-supportappcompat-v726-1-0-in-android-studio-new |
I had the same issue with flutter map_view plugin, added subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
} to the end of android/build.gradle and it solved the issue. |
imagine the hassle when we migrate to android jetpack androidx packages |
worked, dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true |
Same error, but against
Added this to resolve. resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.0.1"
}
} |
When I do this my app compiles, but it crashes at the app start with no error in the logs |
I also did the 27.1.0 fix and it crashes at app start. |
Is there any way to resolve this without cargo culting? |
I was able to solve this in a different way. Maybe it will work for some of those who are still experiencing difficulty @dannnnthemannnn In so it now looks like: dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "com.android.support:support-v4:27.1.1" // added this
}
|
It works when I add as below subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
} |
the solution works fine. |
thank you it's working for me |
Only this solution works for my situation. The one to change android/build.gradle doesn't work. |
I also had the same issue and solved it by adding subprojects { at the end of android/build.gradle file |
this solution works for my situation. |
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 receive an error when i run flutter run
My gradle.build file is:
flutter doctor:
The text was updated successfully, but these errors were encountered: