2015-10-13 71 views
3

我面臨未知類型的錯誤`錯誤:任務':app:dexDebug'的執行失敗。錯誤:android工作室中的任務':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`

我的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:[email protected]' 
compile 'com.android.support:recyclerview-v7:23.0.1' 

}

我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 
+1

請添加錯誤 –

+0

類似問題的完整堆棧跟蹤http://stackoverflow.com/questions/29045129/android-java-exe-finished-with-non-zero-exit-value-1你有沒有試過這些答案? – Raghavendra

+0

是的,我查過了但我找不到合適的答案 –

回答

0

這是唯一的錯誤日誌你?沒有更詳細的?你可以嘗試添加到你的Android標記內的gradle文件。

compileOptions { 
    sourceCompatibility JavaVersion.VERSION_1_7 
    targetCompatibility JavaVersion.VERSION_1_7 
} 
+0

沒有這個不適合我 –

+0

而你的錯誤日誌不是更詳細嗎?正是你發佈的內容? –

+0

看到我編輯的問題 –

-1

的問題是在你的應用程序 - 這條線:

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) 

看起來你有setImageView當某個地方,這應該是SetImageView - 也許在一個XML文件?

1

我想嘗試幫忙,因爲我面對同樣的問題和你在一起。這是我做我的項目

  1. 嘗試將buildToolsVersion從「23.0.1」更改爲「23.0.0」或其他
    版本
  2. 清潔項目
  3. 改造項目

我認爲這是從Android SDK buildToolVersion

3

此步驟爲我工作的bug:

  • 卸載手機中的/模擬器
  • 圍棋中應用建立菜單,然後再次單擊清理項目
  • 運行應用程序
+1

你能解釋一下嗎? –

+0

這不提供問題的答案。一旦你有足夠的[聲譽](http://stackoverflow.com/help/whats-reputation),你將能夠[評論任何職位](http://stackoverflow.com/help/privileges/comment);相反,[提供不需要提問者澄清的答案](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- I-DO-代替)。 - [來自評論](/ review/low-quality-posts/12154669) – Robert

+1

這不是爲了提供一個答案,@Robert?這不是非常高的質量,但它肯定看起來像一個答案。 – Undo

0

我DONOT知道這是否是正確答案與否。但是如果你的一些jar文件沒有正確編譯,就會發生這種情況。 您可以在清理前再次同步您的項目,或者您可以刪除添加的最後一個jar文件,然後進行同步。 希望它有幫助。

相關問題