com.android.dex.DexIndexOverflowException merging dependencies or error that java.exe finished with non-zero exit value 2

來源:互聯網
上載者:User

標籤:

  這個問題困擾我好一兩天了,現在解決了這個麻煩的問題,我覺得有必要以部落格的形式描述一下我這段心酸的解決經曆,在網上查了好多關於這方面的資料,大多都是說編譯的jar包,或者libs重複之類的(我用的是AS),但是我仔細看了好幾遍我的builde.gradle檔案,沒有這個問題的存在,所以我就很納悶,幾番折騰,我覺得還是從錯誤log中去找bug的根源,發現 java.exe finished with non-zero exit value 2還是由com.android.dex.DexIndexOverflowException這個錯誤導致的,所以我在overflowStack網上找到了答案(http://stackoverflow.com/questions/33590477/unexpected-top-level-exception-com-android-dex-dexindexoverflowexception-mergin),different version of the same library and may be unnecessary dependencies(存在不同版本的類庫和沒有必要的依賴),這將會導致這樣的錯誤,Since the gradle plugin 0.14.0 and the Build Tools 21.1.0 you can use the multidex support.。解決這個問題可以在你的builde.gradle檔案中的defaultConfig中添加MultidexEnabled true,dependencies中添加compile‘com.android.support:multidex:1.0.0‘,這樣,奇蹟就會發生。

com.android.dex.DexIndexOverflowException merging dependencies or error that java.exe finished with non-zero exit value 2

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.