2015-05-02 68 views
4

我以前的播放服務的版本是87年6月5日,我升級到7.0.0,然後得到這個錯誤的java.exe完成了非零退出值2

com.android.ide.common.process。 ProcessException: org.gradle.process.internal.ExecException:進程的命令 'C:\ Program Files \ Java \ jdkx.x.x_xx \ bin \ java.exe'' 非零退出值2

compile 'com.google.android.gms:play-services:6.5.87' 

我已升級播放服務然後....現在我的gradle是

dependencies { 
compile project(':com_facebook_android') 
compile project(':pullToRefreshLib') 
compile project(':smoothProgressbarLib') 
compile project(':progressMaterial') 
compile 'com.android.support:support-v4:22.0.0' 
compile 'com.google.android.gms:play-services:7.0.0' 
compile 'com.google.code.gson:gson:2.3' 
compile 'com.jakewharton:butterknife:6.1.0' 
compile files('libs/android-async-http-1.4.6.jar') 
compile files('libs/commons-io-2.4.jar') 
compile files('libs/google-api-client-1.4.1-beta.jar') 
compile files('libs/google-api-client-googleapis-1.4.1-beta.jar') 
compile files('libs/jackson-core-asl-1.6.7.jar') 
compile files('libs/jeval.jar') 
compile files('libs/jscience.jar') 
compile files('libs/libGoogleAnalyticsV2.jar') 
compile files('libs/nineoldandroids-2.4.0.jar') 
compile files('libs/universal-image-loader-1.9.3.jar') 
compile files('libs/YouTubeAndroidPlayerApi.jar') 
compile files('libs/guava-r09.jar') 

有沒有衝突庫?

回答

16

沒有人回答。我發現....解決方法就是在menifest文件

<application 
     android:name=".MyApplication" 
     android:allowBackup="true" 
     android:icon="@drawable/app_icon" 
     android:label="@string/app_name" 
     android:largeHeap="true" 
     android:theme="@style/Theme.MyAppTheme"> 

我gradle這個文件

android { 
compileSdkVersion 21 
buildToolsVersion "22.0.1" 

defaultConfig { 
    applicationId "com.winapp" 
    minSdkVersion 14 
    targetSdkVersion 21 
    multiDexEnabled = true 
} 

buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
    } 
} 

compileOptions { 
    sourceCompatibility JavaVersion.VERSION_1_7 
    targetCompatibility JavaVersion.VERSION_1_7 
} 

packagingOptions { 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'META-INF/LICENSE.txt' 
} 

dexOptions { 
    preDexLibraries = false 
    incremental true 
    javaMaxHeapSize "4g" 
} 

afterEvaluate { 
    tasks.matching { 
     it.name.startsWith('dex') 
    }.each { dx -> 
     if (dx.additionalParameters == null) { 
      dx.additionalParameters = ['--multi-dex'] 
     } else { 
      dx.additionalParameters += '--multi-dex' 
     } 
    } 
} 
} 
+0

非常感謝您......爲我節省了這麼多天 – user987760

+0

我無法繼承MultiDexApplication :(如何得到它? – NarendraJi

+0

您是否已經添加了'compile'c​​om.android.support:multidex:1.0.1''? –

2

您將能夠包括對您的gradle這個只有谷歌遊戲服務multidex

public class MyApplication extends MultiDexApplication { 

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

} 

您將使用的API。在這個環節,你應該選擇的URI在您的項目https://developers.google.com/android/guides/setup#split

例如編譯,如果你只包括谷歌分析,你應該只添加這在gradle這個項目文件

compile 'com.google.android.gms:play-services-analytics:8.1.0' 
相關問題