问题描述
我迁移从Eclipse中我的Android code到Android工作室,一直停留在下面的错误。该项目建立精细和同步与摇篮,但将在编译下面的错误。
意外的顶级例外:
错误:执行失败的任务:应用程序:dexDebug。
我试图解决这种与罐子和库错误,并甚至试图插入
配置{
所有* .exclude组:com.android.support',模块:支持-V4
}
当我在支持库冲突。但是,这似乎是一个不同类型的错误与构建工具。我试图签出inputList.txt文件中提到的路径为/ home /工作/路障/ Android的Studio项目新建/应用程序/编译/中间体/ tmp目录/ DEX /调试/ inputList.txt但一无所获相应和,因为它是建立由该系统。
我的前面的问题(Android工作室未检测上编译支持库)提供的细节有关的项目结构,这似乎从build.gradle删除配置标记之后是错误。我检查了每个使用的文件和库,并删除可能已多次添加的广口瓶,但这个错误仍然存在。
相关内容:
应用插件:com.android.application
安卓{
compileSdkVersion 19
buildToolsVersion21.1.2
defaultConfig {
的applicationIDpackage.app
的minSdkVersion 8
targetSdkVersion 18
}
buildTypes {
推出 {
minifyEnabled假
proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'ProGuard的-rules.txt
}
}
}
依赖{
编制项目(:facebookSDK)
编制项目(':库)
编制项目(:newPagerIndicator)
编制项目(:pulltorefreshlib)
编制项目(:排)
编译com.android.support:support-v4:19.1.0
编译com.google.android.gms:播放服务:+
编译com.actionbarsherlock:actionbarsherlock:4.4.0@aar
编译文件(库/ FlurryAnalytics_3.3.3.jar)
编译文件(库/ crittercism_v3_2_0_sdkonly.jar)
编译文件(库/ httpmime-4.2.5.jar)
编译文件(库/ nineoldandroids-2.4.0.jar)
编译文件(库/毕加索-2.3.3.jar)
编译文件(库/通用图像装载-1.8.4.jar)
}
在Android建立故障切换com.android.dex.DexException:多DEX文件定义Landroid /支持
解决与排除
为
相关性{
编译文件树(导演:库,包括:的* .jar,排除:Android的支持 - *罐子。)
// ...
}
和
在Multiple DEX文件定义Landroid /支持/ V4 / accessibilityservice / AccessibilityServiceInfoCompat 很容易为排除模块:支持-V4
例如
相关性{
编译(com.commonsware.cwac:相机-V9:0.5.4'){
排除模块:支持-V4
}
编译com.android.support:support-v4:18.0.+
}
(也贴到Gradle排除或添加引用硬包括库内classes.jar JAR文件)
I am migrating my Android code from Eclipse to Android studio and have been stuck at the following error. The project builds fine and syncs with gradle, but it throws the following error on compiling.
UNEXPECTED TOP-LEVEL EXCEPTION:
Error:Execution failed for task ':app:dexDebug'.
I have tried to resolve this kind of error with jars and library and have even tried inserting
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
when I had conflicts in the support library. But this seems to be a different kind of error with the build tools. I tried to checkout the inputList.txt file as mentioned in the path /home/Work/Roadblock/Android Studio Projects New/app/build/intermediates/tmp/dex/debug/inputList.txt but found nothing relevent as it is build by the system.
My earlier question (Android Studio not detecting support libraries on Compilation) provides details about the project structure and this seems to be the error after removing the configurations tag from build.gradle. I checked each of the files and libraries used and removed the jars which might have been added multiple times, but this error still persists.
DEPENDENCIES:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "package.app"
minSdkVersion 8
targetSdkVersion 18
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':facebookSDK')
compile project(':library')
compile project(':newPagerIndicator')
compile project(':pulltorefreshlib')
compile project(':volley')
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile files('libs/FlurryAnalytics_3.3.3.jar')
compile files('libs/crittercism_v3_2_0_sdkonly.jar')
compile files('libs/httpmime-4.2.5.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/picasso-2.3.3.jar')
compile files('libs/universal-image-loader-1.8.4.jar')
}
In Android build fails over com.android.dex.DexException: Multiple dex files define Landroid/support
Solved with exclude
as
dependencies {
compile fileTree(dir: 'libs', include: '*.jar', exclude: 'android-support-*.jar')
//...
}
and
At Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat it easy as exclude module: 'support-v4'
example
dependencies {
compile('com.commonsware.cwac:camera-v9:0.5.4') {
exclude module: 'support-v4'
}
compile 'com.android.support:support-v4:18.0.+'
}
(also posted to Gradle Exclude or add reference for JAR file hard included inside library classes.jar)
这篇关于顶级异常的应用程序:dexDebug --dex - 无 - 优化 - 输出机器人工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!