Fumarja
Fumarja

Reputation: 137

Android Gradle support libraries must use same version

I already looked at every other questions and googled the impossible but I cannot find a way to use correct dependencies. Below there is my app Gradle build file:

 buildscript {
 repositories {
    google()
    jcenter()
 }
 dependencies {
    classpath 'com.android.tools.build:gradle:3.3.0-alpha01'
 }
}
apply plugin: 'com.android.application'

repositories {
     jcenter()
     google()
}

android {
    compileSdkVersion 27

Upvotes: 2

Views: 506

Answers (4)

mudit_sen
mudit_sen

Reputation: 1510

Hey just exclude the appcompat dependencies from the libraries which are using an older version of appcompat and support libraries. If you don't have these support libraries in your project then include them. In your question, braintreepayments is one of the libraries which using an older version of card view and design library. Try changing your gradle dependencies to

dependencies {
    ...
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation ('com.braintreepayments.api:drop-in:3.0.0'){
        exclude group: 'com.android.support'
    }
    ...
}

Upvotes: 4

halfer
halfer

Reputation: 20487

(Posted on behalf of the question author).

The problem, as mudit_sen helped me find out, was the Braintree dependency:

implementation 'com.braintreepayments.api:drop-in:3.0.0'

I removed that line as I don't need it and it was from a previous project and now everything is working as intended. Thank you very much.

Update

For people that wants to use Braintree library the solution to me was to use

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

implementation 'com.android.support:support-v4:27.0.0'

with

implementation 'com.braintreepayments.api:drop-in:3.4.0'

Upvotes: 0

Ankit
Ankit

Reputation: 27

Remove buildToolsVersion "27.0.3" from your gradle file.

Or you should check this-- buildToolsVersion "27".

Good luck

Upvotes: 0

Pavel Sarpov
Pavel Sarpov

Reputation: 73

You should either downgrade appcompat library so its version be lowe then build tools version but still 27th, or upgrade build tools version up to appcompat. Check different compounds to find completely the same verstion

Upvotes: 0

Related Questions