Jagdeesh
Jagdeesh

Reputation: 119

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

I have error at this line showing

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.0

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

its my

app.gradle

apply plugin: 'com.android.application'


android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.akhilkumar.chitchat"
        minSdkVersion 21
        targetSdkVersion 26
        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:26.1.0'
    implementation 'com.android.support:customtabs:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    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.google.firebase:firebase-core:16.0.0'
    implementation 'com.google.android.gms:play-services-location:9.2.0'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:10.2.1'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
}
apply plugin: 'com.google.gms.google-services'

Upvotes: 0

Views: 3197

Answers (3)

Boiy
Boiy

Reputation: 19

I solved this by doing this by simply changing

implementation 'com.android.support:design:26.1.0'

To

implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'

I hope this helps... also do a gradle update specifically for react native navigation v2

Upvotes: 1

MohammadAli
MohammadAli

Reputation: 3456

This error comes because you can use older version so simply update your version dependencies.

Change :

compileSdkVersion 26 or targetSdkVersion 26

TO

compileSdkVersion 27 or targetSdkVersion 27

Also Change :

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

implementation 'com.android.support:customtabs:27.1.1'

implementation 'com.android.support:design:27.1.1'

Sync.. and Clean & ReBuild

Upvotes: 2

Jagdeesh
Jagdeesh

Reputation: 119

apply plugin: 'com.android.application'


android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.akhilkumar.chitchat"
        minSdkVersion 21
        targetSdkVersion 27
        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:27.1.1'
    implementation 'com.android.support:customtabs:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    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.google.firebase:firebase-core:16.0.0'
    implementation 'com.google.android.gms:play-services-location:9.2.0'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:10.2.1'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
}
apply plugin: 'com.google.gms.google-services'

Upvotes: 0

Related Questions