错误:在Eclipse项目导入到Android Studi住宅后,执行失败的任务“:dexDebug:应用” [英] Error:Execution failed for task ':app:dexDebug' after importing project from Eclipse to Android studi
问题描述
我导入的项目从Eclipse中到Android。然后我得到这个错误消息后,我试图运行的应用程序。
错误:执行失败的任务:应用程序:dexDebug。
com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:过程'命令'C:\\ Program Files文件(x86)的\\的Java \\ jdk1.8.0_40 \\斌\\ java.exe的'完成非零退出值2
块引用>据接缝这样的问题:
<一href=\"http://stackoverflow.com/questions/28917696/errorexecution-failed-for-task-appdexdebug-com-android-ide-common-process\">Error:Execution失败的任务:应用程序:dexDebug。 com.android.ide.common.process.ProcessException不过,我尝试了所有的答案,他们的非工作。
下面是我的build.gradle
应用插件:'com.android.application
安卓{
compileSdkVersion 21
buildToolsVersion22.0.1
compileOptions.encoding ='Windows的1251'defaultConfig {
的applicationIDsk.app
15的minSdkVersion
targetSdkVersion 21
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard的-rules.txt
}
}
} 依赖{
编译com.android.support:support-v4:23.1.1
编译com.google code.gson:GSON:2.3
编译文件(库/没有activation.jar')
编译文件(库/ droidText.0.4.jar')
编译文件(库/谷歌播放services.jar')
编译文件(库/的mail.jar')
}
解决方案我有这个ProcessException.From我所看到的这主要是由于64K方法限制。因为你的项目有很多图书馆加入这也可能意味着,他们几个是重复的,这可能会发生。
问题我是64K的限制,因为重复的依赖交叉包括通过PlayServices。 <一href=\"http://stackoverflow.com/questions/32824788/processexception-when-buildtoolsversion-is-changed-from-22-0-1-to-23-0-1\">ProcessException当buildToolsVersion从22.0.1变更为23.0.1 是我的问题回答SOF。
我觉得你的情况,似乎并没有被我的问题。但你仍然可以有multidex启用。做到这一点用在65K方法以下开发应用程序。
另外的尝试最新版本的工具版本是23.0.2从的打造工具的。
修改
有关@EsoRimmer,它不只是工作,使MultiDex但最新版本的工具版本与它一起做它的工作。因此,使用最新版本的工具总有办法,以避免不必要的问题。
I imported project from Eclipse to Android. Then i get this error message after i tried to run application.
Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 2
It seams like this problem: Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException
But I tried all of the answers and non of them worked.
Here is my build.gradle
apply plugin: 'com.android.application'
android { compileSdkVersion 21 buildToolsVersion "22.0.1" compileOptions.encoding = 'windows-1251' defaultConfig { applicationId "sk.app" minSdkVersion 15 targetSdkVersion 21 compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:support-v4:23.1.1' compile 'com.google.code.gson:gson:2.3' compile files('libs/activation.jar') compile files('libs/droidText.0.4.jar') compile files('libs/google-play-services.jar') compile files('libs/mail.jar') }
解决方案I had this ProcessException.From what I have seen it is mainly due to the 64k method limitation. This may occur because your project has so many libraries added which may also mean that few of them are duplicate.
Issue I had was 64k limitation crossed because of duplicate dependencies included through PlayServices. ProcessException when buildToolsVersion is changed from 22.0.1 to 23.0.1 is my issue answered in SOF.
I think in your case that does not seem to be an issue for me. But still you can have multidex enabled. Do that too by following Building Apps with Over 65K Methods.
Also try the latest build tools version which is 23.0.2 from build-tools.
EDIT
For @EsoRimmer, it did not work just with MultiDex enabled but latest build tools version along with it made it work. So, using the latest build tools always a way to avoid unnecessary issues.
这篇关于错误:在Eclipse项目导入到Android Studi住宅后,执行失败的任务“:dexDebug:应用”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!