2016-01-25 130 views
0

我用我的build.gradle以下依存關係:收到錯誤:執行失敗的任務 ':應用程序:dexDebug'

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.5.2' 
compile 'com.parse:parse-android:1.11.0' 
compile 'com.parse.bolts:bolts-android:1.3.0' 
compile 'com.google.android.gms:play-services:7.5.0' 
compile 'com.mixpanel.android:mixpanel-android:4.6.4' 
compile project(':intercom-sdk-base') 
compile project(':intercom-sdk-gcm') 
compile 'com.stripe:stripe-android:1.0.3' 

}

我評論過線compile fileTree(dir: 'libs', include: ['*.jar'])

要避免不匹配,但仍然會出現以下錯誤:

Error:Execution failed for task ':app:dexDebug'> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 2

+0

你可以發佈完整的錯誤信息。 – Raghavendra

+1

你可以使用'compile'c​​om.parse:parse-android:1.12.0''而不是'1.11.0' –

+0

顯示錯誤日誌&post'build.gradle'總數。 –

回答

1

您需要新增multiDexEnabled true。禮貌去multiDexEnabled

The Android plugin for Gradle available in Android SDK Build Tools 21.1 and higher supports multidex as part of your build configuration. Make sure you update the Android SDK Build Tools tools and the Android Support Repository to the latest version using the SDK Manager before attempting to configure your app for multidex.

defaultConfig { 
    ... 
    minSdkVersion //Your Version 
    targetSdkVersion //Your Version 
    ... 

    // Enabling multidex support. 
    multiDexEnabled true 
} 

調用此您關聯

dependencies { 
    compile 'com.android.support:multidex:1.0.1' 
} 

諮詢

您可以使用compile 'com.parse:parse-android:1.12.0'

然後Clean-Rebuild-Restart-Sync您的項目。希望這可以幫助 。

0

這種情況發生得非常頻繁。

只是「清理項目」 - >「重建項目」,你會很開心。

+0

我已經完成了..不工作.. – user5716019

相關問題