question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android dependency 'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.1.0) classpath.

See original GitHub issue

Steps to reproduce

1.When I introduced it, I got the following error in Android.

* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.1.0) classpath. You should manually set the same version via DependencyResolution

I use the following version in my project and don’t want to update the new version.

    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:appcompat-v7:26.1.0'

Expected behaviour

Can be compatible with the version I am using, without updating to 27.1.0

Environment

Environment: OS: macOS High Sierra 10.13.4 Node: 8.3.0 Yarn: Not Found npm: 5.3.0 Watchman: Not Found Xcode: Xcode 9.4.1 Build version 9F2000 Android Studio: 3.1 AI-173.4819257

Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.51.0 => 0.51.0

react-native-share

“react-native-share”: “^1.1.2”,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

13reactions
xhirazicommented, Nov 1, 2018

@suwu150 it will solve by using In app/build.gradle

implementation (project(':react-native-share'))
{
  exclude group: "com.android.support"
} 
2reactions
mikehardycommented, Oct 28, 2018

This question and the first answer describe the whole thing and how to control it as deeply as you want:

https://stackoverflow.com/questions/48027019/how-to-manage-different-support-library-versions-for-3rd-party-deps-with-gradle

Note that in my projects I don’t go as far as re-programming the dependency resolution behavior of gradle as the original question (in the second part) and the answer discuss, I simply use the “naive” (read as: simple, but works) style the question first discusses and it is sufficient for my needs while being understandable for other collaborators that aren’t as familiar with gradle.

Please let us know if this works as the newest version here actually moves to support 28 etc…

Read more comments on GitHub >

github_iconTop Results From Across the Web

'com.android.support:appcompat-v7' has different version for ...
Android dependency 'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.0.1) classpath.
Read more >
Android dependency has different version for the compile and ...
android.support:support-support-v4' has different version for the compile (25.2.0) and runtime (26.0.0-beta2) classpath.
Read more >
Support Library Packages - Android Developers
Each of these libraries supports a specific range of Android platform versions and set of features. This guide explains the important features and…...
Read more >
Android dependency 'com.android.support:support-v4' has ...
[Solved]-Android dependency 'com.android.support:support-v4' has different version for the compile (27.0.1) and runtime (27.1.1) classpath-Flutter.
Read more >
[Solved] All com.android.support libraries must use ... - YouTube
Solving the Android Studio error in gradle file with implementation dependencies of API 28 Android.The text of error is:All ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found