简体   繁体   English

任务':app:preDexDebug'的执行失败添加球衣依赖关系导致生成错误

[英]Execution failed for task ':app:preDexDebug' Adding jersey dependencies give build error

I created an Android project in Intellij with empty activity. 我在Intellij中创建了一个活动为空的Android项目。 And then I added Jersey libraries as dependencies in gradle as follow : 然后我将Jersey库添加为gradle中的依赖项,如下所示:

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  testCompile 'junit:junit:4.12'
  compile 'com.android.support:appcompat-v7:23.1.1'
  compile 'com.android.support:design:23.1.1'

  // dependencies I added
  compile 'com.sun.jersey:jersey-server:1.19'
  compile 'com.sun.jersey:jersey-json:1.19'

} }

It started showing following error : 它开始显示以下错误:

Execution failed for task ':app:preDexDebug'. 任务':app:preDexDebug'的执行失败。

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\\Program Files\\Java\\jdk1.7.0_80\\bin\\java.exe'' finished with non-zero exit value 1 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\\ Program Files \\ Java \\ jdk1.7.0_80 \\ bin \\ java.exe'以非零退出值1

Hey @Kuldeep usually this error is because of multiple file with the same name you must check where is the redundant file and remove it maybe this is from the newly added library also try to add this inside of android tag in gradle file of your project 嘿@Kuldeep通常,此错误是由于多个文件具有相同的名称,您必须检查冗余文件在何处并将其删除,也许这是从新添加的库中也尝试将其添加到项目的gradle文件中的android标签中

   packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'

}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:Gradle:任务执行失败':app:preDexDebug' - Error: Gradle: execution failed for task ':app:preDexDebug' 任务':app:preDexDebug的执行失败 - Execution failed for task ':app:preDexDebug 生成错误,Gradle->错误:任务':app:preDexDebug'的执行失败。 > org.gradle.process.internal.ExecException: - Build error ,Gradle -> Error:Execution failed for task ':app:preDexDebug'. > org.gradle.process.internal.ExecException: 编译时出错-执行失败于':app:preDexDebug' - ERROR at compiling - execution failed at ':app:preDexDebug' Android Studio无法运行项目-错误:任务':app:preDexDebug'的执行失败。 - Android Studio cannot run project - Error:Execution failed for task ':app:preDexDebug'. 模块依赖性导致错误:Gradle:Android Studio中任务':app:preDexDebug'的执行失败 - Module dependency leads to Error:Gradle: Execution failed for task ':app:preDexDebug' in Android Studio 错误:任务':app:preDexDebug'的执行失败。 >…以非零值1结束 - Error:Execution failed for task ':app:preDexDebug'. > … finished with non-zero value 1 app:preDexDebug错误执行失败,使用Java邮件发送邮件 - Execution failed for app:preDexDebug error sending mail using java mail AndroidStudio:任务'app的Gradle构建失败:preDexDebug(ProcessException,ExecException,非零退出值1) - AndroidStudio: Gradle build failed for task 'app:preDexDebug (ProcessException, ExecException, non-zero exit value 1) 错误生成APK错误:任务':app:transformClassesWithDexForRelease'的执行失败 - Error Build APK Error:Execution failed for task ':app:transformClassesWithDexForRelease'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM