错误:程序类型已存在:android.support.design.widget.CoordinatorLayout $ Behavior

时间:2018-06-25 02:36:51

标签: android android-gradle

在上一个项目中更新我的api级别后,问题很多,

错误:程序类型已经存在:android.support.design.widget.CoordinatorLayout $ Behavior

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:3.2.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()

        //admob 24 june 2018

        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

在这里,我在实现'com.android.support:appcompat-v7:27.1.1'和实现'com.google.android.gms:play-services-games:15.0.1'上也获得了红色标记

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.david.aquiz"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 2
        versionName "1.0.1"
        //multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    //mobfox
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.google.android.gms:play-services-games:15.0.1'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.google.android.gms:play-services-plus:15.0.1'
    implementation  'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    //compile 'com.google.android.gms:play-services:10.0.1'
    //dex error
    //compile 'com.android.support:multidex:1.0.1'
}
apply plugin: 'com.google.gms.google-services'

1 个答案:

答案 0 :(得分:1)

将您的支持设计更新为27.1.1

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

还有

compileSdkVersion到27:compileSdkVersion 27