为什么Android Gradle preDexDebug“源和目标必须不同"构建失败? [英] Why Android Gradle preDexDebug "Source and destination must be different" build failed?

查看:24
本文介绍了为什么Android Gradle preDexDebug“源和目标必须不同"构建失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Android Studio 0.8.1 构建的 Android 应用程序并面临这个问题:

I have an Android application built with Android Studio 0.8.1 and facing the issue:

Error:Execution failed for task ':app:preDexDebug'.
> java.lang.IllegalArgumentException: Source C:\Users\mfedorov\AndroidStudioProjects\EPOS2\app\build\intermediates\pre-dexed\debug\mate-api-0.0.1-SNAPSHOT-0ef7e3259aeaf19202f545da97dc6b1ae2502c9a.jar and destination C:\Users\mfedorov.ALTIUS-PLUS\AndroidStudioProjects\EPOS2\app\build\intermediates\pre-dexed\debug\mate-api-0.0.1-SNAPSHOT-0ef7e3259aeaf19202f545da97dc6b1ae2502c9a.jar must be different

这是我的build.gradle文件内容(我改过的部分,其余为默认)

Here's my build.gradle file contents (the part that I have changed, the rest is default)

configurations.all {
    // check for updates every build
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'org.apache.commons:commons-collections4:4.0'
    compile 'org.slf4j:slf4j-android:1.7.7'
    compile 'com.altius.logging:logging-utils:0.0.1-SNAPSHOT'
    compile group: "com.altius.mate", name: "mate-bluetooth", version: "0.0.1-SNAPSHOT", changing: true
    compile group: "com.altius.mate", name: "mate-api", version: "0.0.1-SNAPSHOT", changing: true
    //compile('org.simpleframework:simple-xml:2.7.1') {
    //exclude group: 'stax', module: 'stax-api'
    //exclude group: 'xpp3', module: 'xpp3'
    //}

}

root build.gradle 的内容默认是用android项目创建的

contents of the root build.gradle are default as created with android project

mate-api-0.0.1-SNAPSHOT 工件来自 Maven 本地存储库 mavenLocal()

mate-api-0.0.1-SNAPSHOT artifacts are from Maven local repository mavenLocal()

推荐答案

答案只是清理项目.我有一段时间遇到同样的问题.

The answer was just to clean the project. I was having same problem for some time.

构建 -> 清理项目

这篇关于为什么Android Gradle preDexDebug“源和目标必须不同"构建失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆