4

ll com.android.support libraries must use the exact same version

specification (mixing versions can lead to runtime crashes). Found versions 28.0.0-alpha1, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0-alpha1 and com.android.support:customtabs:26.1.0 less... (Ctrl+F1) There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).

my gradle dependencies:-

implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'

warning on this dependencies -----------------------------

implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
testImplementation 'junit:junit:4.12'
implementation 'com.google.android.gms:play-services-vision:15.0.2'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
implementation 'com.memetix:microsoft-translator-java-api:0.6.2'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.facebook.android:audience-network-sdk:4.+'

enter image description here

enter image description here>

Zoe
  • 27,060
  • 21
  • 118
  • 148
Jaymin Bhadani
  • 868
  • 5
  • 10
  • 25

5 Answers5

6

Something's using older library and The culprit is firebase-core:16~;

After quite some trials I resolved this issue.

From this answere and this answer I solved the error.

You need to manually add dependencies that are conflicting. (To find conflicting dependencies an easy way is to hover over highlighted errors.) You can either downgrade your appcompat library to the given/hinted one which is not recommended or manually declare those dependicies.

I Used this code with all updated libraries today and solved errors:

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:28.0.0-rc01'

implementation 'com.android.support.constraint:constraint-layout:1.1.2'

//this thing is carusing error, to solve - see hints and manually add them.

implementation 'com.google.firebase:firebase-core:16.0.1'

implementation 'com.android.support:support-media-compat:28.0.0-rc01'

implementation 'com.android.support:support-v4:28.0.0-rc01'


//implementation 'com.android.support:appcompat-v7:25.2.0'
/*implementation ("com.google.firebase:firebase-core:16.0.1"){
    exclude group: 'com.android.support'
}
*/

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'
}

Such behavior makes new developers head scratch.

If this solves your problem please let others know too. Happy coding.

Update.

Note: Don't forget to check if there's other libraries added to your project causing warning.

Proof of its working. enter image description here

Rifat
  • 1,700
  • 3
  • 20
  • 51
  • 1
    chcek other stuff. like firabase ads. say what warning you got after using this method. Add them too and it will work. – Rifat Aug 23 '18 at 04:44
  • @JayminBhadani maybe you are not testing it correctly. As it has latest rc-01 version and yours alpha-1. – bulliedMonster Aug 23 '18 at 05:01
  • same problem with rc-01..! this problem with freebase lib version if i remove freebase lib it working but i need it thanks.! – Jaymin Bhadani Aug 23 '18 at 05:22
1

Use this dependencie

implementation 'com.android.support:appcompat-v7:27.1.1'

  • 1
    getting this warring when use this dependencies "All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 26.1.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:customtabs:26.1." – Jaymin Bhadani Aug 21 '18 at 12:35
1

This is caused because your image cropper library contains older version of support library. Use this on your Image Cropper library:

implementation ("com.theartofdev.edmodo:android-image-cropper:2.3.+"){
    exclude group: 'com.android.support'
}

This will remove your gradle issue .

nitinkumarp
  • 2,120
  • 1
  • 21
  • 30
1

Use this dependencies below

implementation 'com.android.support:support-v4:28.0.0'
ibhavikmakwana
  • 8,948
  • 4
  • 20
  • 39
Navin Kumar
  • 3,393
  • 3
  • 21
  • 46
1
implementation ("com.theartofdev.edmodo:android-image-cropper:2.3.+"){
    exclude group: 'com.android.support'
}

nitinkumarp gives working advice. Perhaps the conflict has several dependencies. You need to check each one, remove all dependencies and add and synchronize one by one until a warning appears. This will be the dependency that causes the warning.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
  • This appears to be a comment on [this answer](https://stackoverflow.com/a/51949439/1364007) by [nitinkumarp](https://stackoverflow.com/users/5260051/nitinkumarp) that has been posted as a separate answer. – Wai Ha Lee Mar 13 '19 at 18:31