这是我在stackoverflow上的第一篇文章,不幸的是它是一个关于bug的问题:'(。在我将Github上的项目添加到Android Studio后, ,但是当我建立的APK到我的手机上运行,它给我的错误:使用Wheel Picker执行任务':app:transformClassesWithJarMergingForDebug'失败
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'
请帮助我:'(这是我的第一个大项目。谢谢
你添加WheelPicker作为一个项目,并编制了库? –
我添加它作为一个模块这里的链接https://github.com/AigeStudio/WheelPicker –
从你的依赖删除编译'cn.aigestudio.wheelpicker:WheelPicker:1.1.2'。 –