如何修复错误:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException: [英] How fix Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
问题描述
我在Eclipse中有一个项目,当我同步项目时,我导出到gradle项目并在Android Studio中打开 错误:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException: 错误:任务':app:mergeDebugResources'的执行失败.
I have a project in Eclipse and I export to gradle project and open in Android Studio when I sync project I get Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error:Execution failed for task ':app:mergeDebugResources'.
错误:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
这是我的build.gradle:
This is my build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.smok.maps"
minSdkVersion 8
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile 'joda-time:joda-time:2.3'
compile files('libs/ksoap2-android-assembly-3.6.0-jar-with-dependencies.jar')
compile files('libs/osmbonuspack_v4.9.jar')
compile files('libs/osmdroid-android-4.2-javadoc.jar')
compile files('libs/osmdroid-android-4.2.jar')
compile files('libs/slf4j-android-1.5.8.jar')
}
推荐答案
好吧,我遇到了这个问题,因为我的项目是从Eclipse导入到Android Studio的,而gradle中缺少了依赖项.
Well, I got this issue because my project was imported from Eclipse to Android Studio and dependencies were missing in gradle.
添加后我摆脱了它
useLibrary 'org.apache.http.legacy'
在
defaultConfig {
}
下方
targetSdkVersion 25
之后,我必须设置
minSdkVersion 9
我还添加了以下几行
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
上方
defaultConfig {
//code snippet
}
因此,看起来像
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
defaultConfig {
applicationId "xxx.xxxx.xxxx.xxxx"
minSdkVersion 9
targetSdkVersion 25
useLibrary 'org.apache.http.legacy'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_5
targetCompatibility JavaVersion.VERSION_1_5
}
//remaining code snippet
//.....
}
//remaining code snippet
//.....
}
@tompok,您可能会收到此错误,可能是由于依赖项中使用的jar文件可能不存在.
@tompok, you are getting this error maybe due to jar files you are using in dependencies may not be there.
代替Google的gradle依赖项,将包名称放在路径的位置,就像在第一行中一样:
Instead Google for their gradle dependencies and place the package name in place of path like it is in first line:
compile 'com.android.support:support-v4:19.1.0'
以上述格式替换剩余的依赖项.
Replace remaining dependencies in the above format.
希望,它将为您提供帮助.
Hope, it will help you.
______________________________________
由于使用的是buildToolsVersion 25.0.2
,而您使用的库是compile 'com.android.support:support-v4:19.1.0'
You are facing this problem since you are using buildToolsVersion 25.0.2
whereas library you are using is compile 'com.android.support:support-v4:19.1.0'
只需将其更改为compile 'com.android.support:support-v4:25.0.2'
,您的问题就会得到解决.
Just change it to compile 'com.android.support:support-v4:25.0.2'
and your issue will be solved.
如果您遇到任何其他问题,请问是否接受它作为答案,这样可能会对其他人有所帮助.
Ask if you face any other issue else accept it as answer so it may help others.
这篇关于如何修复错误:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!