A
A
AndroidApi2019-07-01 17:31:19
Android
AndroidApi, 2019-07-01 17:31:19

How to fix the error in differences in library specifications?

When I add this to my build.gradle(Module):

implementation 'com.google.android.gms:play-services-ads:18.0.0'

This line of code is underlined in red:
implementation 'com.android.support:appcompat-v7:28.0.0'

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 25.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-media-compat:25.1.0 less... (Ctrl+F1)
Inspection info: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). Issue id: GradleCompatible
Dependencies using groupId com.android.support and androidx.* can not be combined but found IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='customview', myVersion='28.0.0', myPacking='aar', myClassifier='null'} and IdeMavenCoordinates{myGroupId='androidx.asynclayoutinflater', myArtifactId='asynclayoutinflater', myVersion='1.0.0', myPacking='aar', myClassifier='null'} incompatible dependencies less... ( Ctrl+F1)
Inspection info: 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). Issue id:
Manifest merger failed : Attribute [email protected] value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:11:5-49:19 to override.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Varakosov, 2019-07-01
@thelongrunsmoke

The gms libraries since version 18 use androidx instead of the old support libraries.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question