Problem when deploying to Gradle Braintree in Android Studio

0

I am trying to implement in a Braintree application and the following problem arises. When I try to add the following dependency.

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

Skip the following Error:

  

Error: Program type already present:   android.support.design.widget.CoordinatorLayout $ Behavior

Investigate and I found that to correct it, add:

allprojects {
repositories {
    google()
    jcenter()
    maven {
        url "https://maven.google.com"
    }
  }
}

But it did not work.

Change the version to 27 and it does not work either, I would really appreciate a help with this problem.

android {
compileSdkVersion 28
defaultConfig {
    applicationId "termo.com.pagosbraintree2"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
 }
}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'com.braintreepayments.api:drop-in:3.3.0'
implementation 'com.loopj.android:android-async-http:1.4.9'



}
    
asked by Fulano 20.12.2018 в 12:17
source

1 answer

1

I see that you use compileSdkVersion 28 and targetSdkVersion 28 , the problem is surely that the library:

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

is using the support library but from a version other than 28.

I suggest defining it as a dependency:

dependencies {
   ...
   ...
   implementation 'com.android.support:design:28.0.0'
   ...
   ...
  }
    
answered by 20.12.2018 в 18:39