这是我的应用程序gradle文件。我得到的确切错误是以下
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.>com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/github/barteksc/pdfviewer/listener/OnPageChangeListener;
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.daniel.haughton93.dunnesstoresoffers"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {}
}
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support',
module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile files('src/main/java/com/daniel/haughton93/dunnesstoresoffers/jsoup-1.10.1.jar')
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile 'com.github.barteksc:android-pdf-viewer:2.3.0'
}
答案 0 :(得分:0)
这个问题是由于android-pdf-viewer的依赖性,所以尝试下面的步骤可能会得到解决方案。
答案 1 :(得分:0)
我建议你真正拿出你不需要的所有id和引用,然后制作一个Clean Project然后重建。
如果上述方法无效,请修改build.gradle(Modude:app),如下所示:
android {
defaultConfig {
...
minSdkVersion 21
targetSdkVersion 25
multiDexEnabled true <-- the line that matters
}
...
}
希望它有所帮助!!!