[英]Execution failed when running app in Android Studio
I am working on a program in Java Android with a log in system that communicates via webservice with a database. 我正在使用登录系统通过网络服务与数据库进行通信的Java Android中的程序。 When i add the encryption algorithm and the necessary jars I get the following error: 当我添加加密算法和必要的jar时,出现以下错误:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. 错误:任务':app:transformClassesWithDexForDebug'的执行失败。
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\\Program Files\\Java\\jdk1.7.0_45\\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_45 \\ bin \\ java.exe'以非零退出值1
This is my gradle file: 这是我的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "andreea.example.com.mobileapp"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile files('libs/apache-httpcomponents-httpclient.jar')
compile files('libs/apache-httpcomponents-httpcore.jar')
compile files('libs/jsr177.jar')
compile files('libs/commons-lang3-3.4.jar')
compile files('libs/android-support-v4.jar')
compile files('libs/commons-codec-1.10.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/commons-lang3-3.4.jar')
}
[UPDATE] I have solved the previous issue, but i now get the following error: (i have also added - multiDexEnabled true - in gradle) [更新]我已经解决了上一个问题,但是现在出现以下错误:(我还添加了-multiDexEnabled true-gradle)
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. 错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/DrawableRes.class com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android / support / annotation / DrawableRes.class
Most likely it's because 65K and you need to enable multidex. 很有可能是因为65K,您需要启用multidex。 But it's just a guess. 但这只是一个猜测。
To understand the problem you can try build project from console by using 要了解问题,您可以尝试通过使用控制台从控制台构建项目
gradle build --debug gradle build-调试
or 要么
gradle build --info gradle build-信息
after it you need to read or share output. 之后,您需要阅读或共享输出。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.