这是我在stackoverflow上的第一篇文章,遗憾的是这是一个关于错误的问题:'(。我将我的项目在Github上添加到Android Studio后,它构建得很好,但是当我构建apk运行时我的手机,它给了我错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/aigestudio/wheelpicker/BuildConfig.class
我在网上搜索了解决方案,但是他们正在说一些重复的课程,并重建项目,但所有这些都不适合我。 这是我的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.tiena.amsconnection"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':WheelPicker')
compile project(path: ':expanding-view')
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.0.1'
}
}
}
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:support-vector-drawable:26.0.1'
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-messaging:11.2.0'
compile 'com.google.firebase:firebase-database:11.2.0'
compile 'com.google.android.gms:play-services:11.2.0'
compile 'com.firebaseui:firebase-ui:2.3.0'
compile 'com.facebook.android:facebook-android-sdk:4.22.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'cn.aigestudio.wheelpicker:WheelPicker:1.1.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.techery:properratingbar:0.0.5'
compile 'com.ramotion.foldingcell:folding-cell:1.2.1'
compile 'com.github.clans:fab:1.6.4'
compile 'com.google.firebase:firebase-storage:11.2.0'
compile 'com.android.support:support-v4:26.+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
请帮助我:'(这是我的第一个大项目。谢谢
答案 0 :(得分:1)
从您的依赖项中删除以下行:
compile 'cn.aigestudio.wheelpicker:WheelPicker:1.1.2'