简体   繁体   English

错误:android studio中的任务':app:dexDebug'执行失败

[英]Error:Execution failed for task ':app:dexDebug' in android studio

I face a unknown type of error`Error:Execution failed for task ':app:dexDebug'. 我面临一个未知类型的错误。错误:任务执行失败':app:dexDebug'。

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\\Program Files\\Java\\jdk1.8.0_51\\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.8.0_51 \\ bin \\ java.exe''以非完成零退出值1`

My build.gradle:- 我的build.gradle: -

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.catalyst.android.shoppingmazza"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.android.support:recyclerview-v7:23.0.1'

} }

My Logtag is here:- 我的Logtag在这里: -

    Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2301Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComDaimajiaSliderLibrary115Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:collectDebugMultiDexComponents UP-TO-DATE
:app:packageAllDebugClassesForMultiDex UP-TO-DATE
:app:shrinkDebugMultiDexComponents UP-TO-DATE
:app:createDebugMainDexClassList UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
    at com.android.dx.command.dexer.Main.processClass(Main.java:752)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
    at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
    at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:672)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:542)
    at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
    at com.android.dx.command.dexer.Main.run(Main.java:275)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
Caused by: com.android.dx.cf.iface.ParseException: class name (com/catalyst/android/shoppingmazza/activity/MainActivity$setImageView) does not match path (com/catalyst/android/shoppingmazza/activity/MainActivity$SetImageView.class)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:749)
    ... 12 more
1 error; aborting
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 25.634 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

This steps worked for me: 这个步骤对我有用:

  • Uninstall the app in your phone/emulator 在手机/模拟器中卸载应用程序
  • Go to Build menu and then click in Clean Project 转到“ 生成”菜单,然后单击“ 清理项目”
  • Run the app again 再次运行该应用程序

i want to try to help, because i faced the same problem with you. 我想尝试帮助,因为我遇到了同样的问题。 And this is what i did to my project 这就是我对我的项目所做的

  1. try to change the buildToolsVersion from "23.0.1" to "23.0.0" or another 尝试将buildToolsVersion从“23.0.1”更改为“23.0.0”或其他
    version
  2. clean the project 清理项目
  3. rebuild project 重建项目

i think it is the bug from the Android SDK buildToolVersion 我认为这是来自Android SDK buildToolVersion的错误

Is this the only error log you get? 这是您获得的唯一错误日志吗? Nothing more detailed? 没有更详细的? You can try adding this to your gradle file inside android tag. 你可以尝试将它添加到android标签内的gradle文件中。

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}

I do not know whether this is the right answer or not. 我不知道这是否是正确的答案。 But this occurs if some of your jar files does not compile properly. 但是,如果您的某些jar文件无法正确编译,则会发生这种情况。

You can sync your project again before cleaning, or you can delete the last jar file added, and then sync. 您可以在清理之前再次同步项目,也可以删除添加的最后一个jar文件,然后同步。

The problem is in your app - this line: 问题出在你的应用中 - 这一行:

Caused by: com.android.dx.cf.iface.ParseException: class name (com/catalyst/android/shoppingmazza/activity/MainActivity$setImageView) does not match path (com/catalyst/android/shoppingmazza/activity/MainActivity$SetImageView.class)

Looks like you have setImageView somewhere when it should be SetImageView - in an XML file perhaps? 看起来你应该在SetImageView某个地方设置setImageView - 在XML文件中?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Studio中的任务“:app:dexDebug”执行失败 - Execution failed for task ':app:dexDebug' in Android Studio 任务':app“ dexDebug的Android Studio执行失败 - Android Studio Execution failed for task ':app"dexDebug 错误:- 在 android 工作室中执行任务 ':app:dexDebug' 失败 - Error :- Execution failed for task ':app:dexDebug' in android studio 任务':app:dexDebug'Android Studio的执行失败 - Execution failed for task ':app:dexDebug' Android Studio 错误:任务':app:dexDebug'...使用android studio执行失败 - Error:Execution failed for task ':app:dexDebug'… using android studio 错误:任务':app:dexDebug'的执行失败。 在Android中 - Error:Execution failed for task ':app:dexDebug'. in android 任务':app:dexDebug'android执行失败 - Execution failed for task ':app:dexDebug' android error android:错误:任务':app:dexDebug'的执行失败 - android : Error:Execution failed for task ':app:dexDebug' Android Studio Build失败,异常执行失败':app:dexDebug' - Android Studio Build failed with an exception Execution failed for task ':app:dexDebug' Android linphone.jar错误:任务':app:dexDebug'的执行失败 - Android linphone.jar Error:Execution failed for task ':app:dexDebug'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM