2016-01-10 65 views
0

在我的android項目,每當我導入地圖活動..編譯給我一些錯誤,如: 錯誤:執行失敗的任務':應用程序:dexDebug'。異常失敗的任務

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_75\bin\java.exe'' finished with non-zero exit value 2

我該如何解決? 我的模塊是:

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
    compile 'com.google.android.gms:play-services:7.5.0' 
} 
+0

你有沒有同步你的gradle? – Krishna

+0

請嘗試使用當前版本的播放服務。編譯'com.google.android.gms:play-services-maps:8.4.0' –

+0

請添加完整gradle文件 – piotrek1543

回答

-1

I also had same issue, i just replaced my 'com.google.android.gms:play-services:8.4.0' with 'com.google.android.gms:play-services-maps:8.4.0' bcs i was implementing google maps in my project, for yours individual need check here , i hope it would work :)

左右,你需要啓用multidex你仍然想使用整個圖書館的一次。這裏是以下步驟:

1:添加multidex依賴於模塊:應用

compile 'com.android.support:multidex:1.0.1' 

2:然後啓用模塊mutidex:應用程序文件中這樣

defaultConfig { 
    ... 
    multiDexEnabled true 
} 

3 defaultConfig部分:添加清單中的清單下面的應用部分

<application 
    android:name="android.support.multidex.MultiDexApplication" 
    ... 
    ... 

4:重建項目。

快樂編碼:)

相關問題