這是我在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'。 –