错误:程序类型已存在:android.support.compat.R

时间:2018-07-06 06:48:33

标签: android android-gradle build.gradle

我清理了项目并重新生成了项目,但仍然收到错误消息:错误:程序类型已存在:android.support.compat.R 这是我的build.gradle

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'


buildscript {
repositories {
    jcenter()

    mavenCentral()

    maven { url 'https://maven.fabric.io/public' }

}

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}

}

allprojects {
repositories {
    maven { url "https://jitpack.io" }
}
}

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
lintOptions {
    abortOnError false
    checkReleaseBuilds false
}
defaultConfig {
    applicationId "example.com"
    minSdkVersion 21
    versionCode 93
    versionName "4.1.7"
    // 92 416
    multiDexEnabled true
}
buildTypes {
    release {
        //   shrinkResources true
        //  minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config
    }
}
// these are the lines that you have to add
packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/MANIFEST.MF'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
}
dataBinding {
    enabled true
}

}

repositories {
maven {
    url "https://repo.eclipse.org/content/repositories/paho-snapshots/"
}
maven { url 'https://maven.fabric.io/public' }

maven {
    url 
   'https://github.com/suckgamony/RapidDecoder/raw/master/repository'
}

}


dependencies {
// implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso- 
core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
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.android.support:customtabs:27.1.1'
implementation 'com.nostra13.universalimageloader:universal-image- 
loader:1.9.5'
implementation 'com.amazonaws:aws-android-sdk-apigateway-core:2.3.1'
implementation 'com.amazonaws:aws-android-sdk-core:2.3.1'
implementation 'com.amazonaws:aws-android-sdk-s3:2.3.1'
//   implementation 'com.google.code.gson:gson:2.7'
//    compile files('libs/com.cielowigle-2.4.8.jar')
/* implementation 'com.google.android.gms:play-services-maps:10.2.6'
    implementation 'com.google.android.gms:play-services- 
location:10.2.6'
    implementation 'com.google.android.gms:play-services-plus:10.2.6'
    implementation 'com.google.android.gms:play-services-gcm:10.2.6'*/
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-plus:15.0.1'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
/* compile 'net.zetetic:android-database-sqlcipher:3.5.4@aar'*/
implementation('org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.1') 
{
    exclude group: 'com.android.support', module:'appcompat'
}
implementation('org.eclipse.paho:org.eclipse.paho.android.service:1.1.2- 
SNAPSHOT') {
    exclude group: 'com.android.support', module:'appcompat'
}
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.github.wangjiegulu:AndroidBucket:1.0.4'
implementation 'com.github.wangjiegulu:ShadowViewHelper:1.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
//  implementation files('libs/bcpkix-jdk15on-1.52.jar')
//   implementation files('libs/bcprov-jdk15on-1.54.jar')
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1'
implementation 'com.wdullaer:materialdatetimepicker:2.5.0'
implementation 'com.facebook.android:facebook-android-sdk:4.27.0'
implementation 'com.nostra13.universalimageloader:universal-image- 
loader:1.9.5'
apply plugin: 'com.google.gms.google-services'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation files('libs/Jsonvalidation.jar')
implementation('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
    transitive = true;
}
implementation 'com.timehop.stickyheadersrecyclerview:library:0.4.1'
implementation 'rapid.decoder:library:0.3.0'
//implementation 'rapid.decoder:jpeg-decoder:0.3.0'
//implementation 'rapid.decoder:png-decoder:0.3.0'
//Retrofit New Libs
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
// Dragger
/* implementation "com.google.dagger:dagger:2.11"
     annotationProcessor "com.google.dagger:dagger-compiler:2.11"
     // provided 'javax.hj:jsr250-api:1.0'
     implementation 'javax.inject:javax.inject:1'*/
implementation 'com.google.dagger:dagger:2.11'
implementation 'com.google.dagger:dagger-android-support:2.11'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.11'
// debug db
debugImplementation 'com.amitshekhar.android:debug-db:1.0.0'
implementation('com.crashlytics.sdk.android:answers:1.4.1@aar') {
    transitive = true;
}
}

我也尝试过使缓存选项无效,但出现相同的错误。我更新了gradle和Google Play服务的最新版本。这在调试选项下有效,但在发布模式下无效。

0 个答案:

没有答案