建立Gradle项目时,“程序类型已经存在”

时间:2018-07-25 17:58:27

标签: android android-gradle build.gradle android-glide

当我在android studio中运行构建时,发生以下错误:

Program type already present: android.support.v4.app.INotificationSideChannel

这些是我使用的依赖项:

apply plugin: 'com.android.application'

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

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

implementation 'com.github.chrisbanes:PhotoView:2.1.4'
// First I tried building with this, but the same problem with a different library error occurred

implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
//Then I tried adding glide, but the same problem occured

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation 'com.google.android.material:material:1.0.0-beta01'
}

该应用未编译,并出现以下错误:

Error: Program type already present: android.support.v4.app.INotificationSideChannel

我看到了Google文档,但并没有太大帮助。 有什么真正的解决方案吗?

0 个答案:

没有答案