2015-10-20 90 views
0

dexDebug錯誤這是在應用程序中使用我的全部app.gradle文件獲取應用程序:在Android Studio中

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 22 
    buildToolsVersion "23.0.0 rc2" 
    defaultConfig { 
     applicationId "com.me.album" 
     minSdkVersion 14 
     targetSdkVersion 22 
     versionCode 4 
     versionName 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
    } 

    lintOptions { 
     checkReleaseBuilds false 
    } 

} 
dependencies { 
    compile 'com.android.support:appcompat-v7:22.2.0' 
    compile 'com.google.code.gson:gson:2.3.1' 
    compile 'com.nineoldandroids:library:2.4.0' 
    compile project('libraries:library') 
    compile project('libraries:animation_library') 
    compile 'de.hdodenhof:circleimageview:1.3.0' 
    compile 'com.android.support:recyclerview-v7:22.2.0' 
    compile 'com.pnikosis:materialish-progress:1.5' 
    compile files('libs/activation.jar') 
    compile files('libs/additionnal.jar') 
    compile files('libs/crittercism_v5_0_6_sdkonly.jar') 
    compile files('libs/httpcore-4.3.3.jar') 
    compile files('libs/httpmime-4.3.6.jar') 
    compile files('libs/mail.jar') 
    compile files('libs/mpandroidchartlibrary-2-1-5.jar') 
    compile 'com.facebook.android:facebook-android-sdk:4.5.0' 
    compile project(':app:libraries:ExpandableLibrary') 
    compile project(':app:libraries:library_appintro') 
    compile project(':app:libraries:library_circular_loading:library') 
    compile 'com.google.android.gms:play-services-maps:6.5.87' 
    compile project(path: ':Push Notification', configuration: 'android-endpoints') 
} 

,並始終得到錯誤

Error:Execution failed for task ':app:dexDebug'. 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 
+0

不安裝該版本在烏拉圭回合SK的經理嗎?的minSdkVersion 14 targetSdkVersion 22 – KOTIOS

+0

是的,我已經安裝了,這在幾天之前工作正常。但是現在,在添加一些依賴關係之後,獲取錯誤 – ranjith

+0

將buildToolsVersion「23.0.0 rc2」更改爲buildToolsVersion「23.0.0」 –

回答

0

最後我得到了解決方案, 它已經在Android WEbLineindia的回答中描述過,但需要一些附加組件。

defaultConfig { 
     applicationId "com.me.album" 
     minSdkVersion 14 
     targetSdkVersion 22 
     versionCode 5 
     versionName "1.5" 
     multiDexEnabled true 
    } 

和依賴

// highest version available 
compile 'com.android.support:multidex:1.0.1' 

,並在你的應用程序類

@Override 
    protected void attachBaseContext(Context base) { 
     super.attachBaseContext(base); 
     MultiDex.install(this); 
    } 
1

在默認配置補充一點:

defaultConfig{ 
       multiDexEnabled = true 
      } 

並在同一build.gradle中添加:

dexOptions { 
    javaMaxHeapSize "4g" 
} 

而在依賴地址:

dependencies 
{ 
compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.android.support:multidex:1.0.0' 
} 

這可以幫助你!

+0

@ Android Weblineindia,我會嘗試。 在依賴中,是否有必要添加其他庫/依賴項目 – ranjith

+0

通過使用這個「編譯fileTree(dir:'libs',include:['* .jar'])」,它可能不需要,但你可以再次檢查您包含的lib /依賴項。但你需要包括multidex:1.0.0 –

+0

我已經嘗試過這種「mutidex」方法,但它在kitkat設備崩潰, 得到錯誤「NoclassDefFoundError」 – ranjith

相關問題