2016-12-07 25 views
0

我需要使用谷歌地圖的地方的代碼,但我遇到了這個崩潰時,我加 編譯'com.google.android.gms:play-services:9.4.0' 如何解決它? 這是我的依賴關係:

 dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support:design:23.4.0' 
    compile 'com.facebook.android:facebook-android-sdk:4.5.0' 
    compile 'de.hdodenhof:circleimageview:2.1.0' 
    compile 'com.mcxiaoke.volley:library-aar:1.0.0' 
    compile 'cn.pedant.sweetalert:library:1.3' 
    compile 'com.squareup.picasso:picasso:2.3.2' 
    compile 'com.android.support:support-v4:23.4.0' 
    compile 'com.android.support:multidex:1.0.0' 
    compile 'com.android.support:cardview-v7:23.4.0' 
    compile 'com.melnykov:floatingactionbutton:1.3.0' 
    compile 'com.google.code.gson:gson:2.7' 
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' 
    compile 'com.onesignal:OneSignal:3.4.1' 
    compile 'com.wang.avi:library:1.0.3' 
    compile 'com.nineoldandroids:library:2.4.0' 
    compile 'io.realm:realm-android:0.87.4' 
    compile 'com.google.android.gms:play-services:9.4.0' 

} 
+0

刪除一個'compile'c​​om.google.android.gms:play-services:9.4.0'' compile'c​​om.google.android.gms:play-services-gcm:9.8.0''。 play-services:9.4.0'是一組完整的服務,::play-services-gcm:9.8.0僅包含GSM服務,這些服務也包含在play-services中:9.4.0' –

+0

我刪除了9.8.0,但是它仍然是一樣的錯誤! – alsalimi

+0

你也用同樣的方式使用'play-services-maps'。我認爲現在的錯誤信息有所不同。 –

回答

0

compile 'com.google.android.gms:play-services:10.0.1'並添加該代碼段的應用程序的build.gredle

android { 
    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/maven/pom.properties' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/dependencies.txt' 
     exclude 'META-INF/LGPL2.1' 
     exclude 'META-INF/gson/FieldAttributes.class' 
     exclude '.readme' 

    } 
} 

或者你可以將此行添加到文件proguard-rules.pro

-dontwarn com.google.** 

可能是這樣解決您的問題,或讓我知道。

相關問題