Android的工作室执行失败的任务“:应用程序:preDexDebug” [英] Android Studio Execution failed for task ':app:preDexDebug'
问题描述
这奇怪的现象是happenning我构建的应用程序。
但奇怪的是,这com.nineoldandroids是一个jar它是从Android的资源库。
我试图删除构建来源和重新编译没有运气。
我的buildgradle:
buildscript {
库{
行家{URLhttp://download.crashlytics.com/maven'}
}
依赖{
类路径com.crashlytics.tools.gradle:crashlytics-摇篮:1 +'
}
}
应用插件:com.android.application
应用插件:crashlytics
库{
行家{URLhttp://download.crashlytics.com/maven'}
}
安卓{
compileSdkVersion 21
buildToolsVersion20.0.0
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
的applicationIDXXXXXXXX
的minSdkVersion 14
targetSdkVersion 21
版本code 1
VERSIONNAME1.0
}
buildTypes {
推出 {
runProguard假
proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
}
调试{
//使crashlytics在您需要
buildConfigField布尔,USE_CRASHLYTICS,假
ext.enableCrashlytics = FALSE
}
}
}
依赖{
编译文件树(导演:库,包括:['的* .jar'])
编制项目(:library_refreshaction_appcompat)
编制项目(:EnhancedListView)
编制项目(:library_numberpicker)
编制项目(:materialDesign)
编制项目(:library_typeface)
编制项目(:library_updatechecker)
编译com.android.support:appcompat-v7:21.0.0
编译com.android.support:support-v4:21.0.0
编译com.crashlytics.android:crashlytics:1.+
编译se.emilsjolander:stickylistheaders:2.5.0
编译文件(库/解析-1.7.1.jar)
编译文件(库/ BixolonPrinter.jar)
编译文件(库/螺栓,Android的1.1.3.jar)
编译文件(库/核心-3.1.0.jar)
编译文件(库/ GSON-2.2.4.jar)
编译文件(库/通用图像装载-1.9.2.jar)
编译文件(库/ VposAPI.jar)
编制项目(:Android的支持,V4- preferencefragment主)
}
错误日志:
错误:未能执行任务:应用程序:preDexDebug。
> com.android.ide.common.internal.LoggedErrorException:无法运行命令:
/Users/Marcus/Downloads/adt-bundle-mac-x86_64-20140702/sdk/build-tools/21.0.2/dx --dex --output /Users/Marcus/Workspace/android-pdv/app/build/intermediates/$p$p-dexed/debug/library-2.4.0-c0bb3fabf202a58f481b22d99eb3ba9b89fd232d.jar /Users/Marcus/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar
错误code:
139
由于联由@zapl <一href="http://stackoverflow.com/questions/19294663/cannot-build-android-project-using-android-studio-gradle-1-7">Cannot构建采用Android工作室的Android项目 - 摇篮1.7 ,这是一个奇怪的行为不只有一个办法来解决它,通过这篇文章为相关
我不能说什么我没有解决这个问题,因为我尝试了很多东西,直到它消失了。
但在帖中称,这是方式:
- 格式不正确的资源(缺少的属性,错误的标签等)
- + ID的样式
- 在重复的资源/库
- 在声明式能够缺少的名字
- 资源失配,尝试使用不同的AAPT的版本。
未知的,像我这样的。因此,这将是有益的:
- 找到一种方法来确定该错误的真正原因
- 在等待更新AAPT,返回一些错误信息
- 写的可能的共同原因的列表。
This strange behavior is happenning with my build application.
The strange is that this com.nineoldandroids is a jar that is from android resource libraries.
I have tried to delete build source and recompile again without luck.
My buildgradle:
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "xxxxxxxx"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
// enable crashlytics where you need
buildConfigField "boolean", "USE_CRASHLYTICS", "false"
ext.enableCrashlytics = false
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':library_refreshaction_appcompat')
compile project(':EnhancedListView')
compile project(':library_numberpicker')
compile project(':materialDesign')
compile project(':library_typeface')
compile project(':library_updatechecker')
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.crashlytics.android:crashlytics:1.+'
compile 'se.emilsjolander:stickylistheaders:2.5.0'
compile files('libs/Parse-1.7.1.jar')
compile files('libs/BixolonPrinter.jar')
compile files('libs/bolts-android-1.1.3.jar')
compile files('libs/core-3.1.0.jar')
compile files('libs/gson-2.2.4.jar')
compile files('libs/universal-image-loader-1.9.2.jar')
compile files('libs/VposAPI.jar')
compile project(':android-support-v4-preferencefragment-master')
}
Error Log:
Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/Marcus/Downloads/adt-bundle-mac-x86_64-20140702/sdk/build-tools/21.0.2/dx --dex --output /Users/Marcus/Workspace/android-pdv/app/build/intermediates/pre-dexed/debug/library-2.4.0-c0bb3fabf202a58f481b22d99eb3ba9b89fd232d.jar /Users/Marcus/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar
Error Code:
139
As linked by @zapl Cannot build android project using Android Studio - Gradle 1.7, it is a strange behaviour that doesn't have only one way to solve it, as related by this post.
I couldn't say exactly what I did to solve it, because I tried many things until it disappeared.
But as said in the post, this is the way:
- Malformed Resources (Missing attributes, wrong tags, etc...)
- +id in Styles
- Duplicated resources / libraries
- Declare-Style able missing name
- Resource miss-match, try to use different AAPT versions.
Unknown, like mine. So it would be useful to:
- Find a way to identify the real cause of this error
- Wait for an update to AAPT that returns some error message
- Write a list of possible common causes.
这篇关于Android的工作室执行失败的任务“:应用程序:preDexDebug”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!