我正在構建一個谷歌地圖和微軟Azure移動服務(雲存儲)使用谷歌播放服務的Android應用程序。 當我只使用Microsoft Azure庫時,我不會遇到任何問題,但是當添加谷歌播放庫時,它會給我以下錯誤。NoClassDefFoundError:com.google.gson.GsonBuilder當使用谷歌播放服務與微軟azure
錯誤
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.gson.GsonBuilder
at com.microsoft.windowsazure.mobileservices.MobileServiceClient.createMobileServiceGsonBuilder(MobileServiceClient.java:192)
at com.microsoft.windowsazure.mobileservices.MobileServiceClient.<init>(MobileServiceClient.java:179)
at com.microsoft.windowsazure.mobileservices.MobileServiceClient.<init>(MobileServiceClient.java:158)
at com.example.jino.navigationplacepicker.ReviewPage.onCreate(ReviewPage.java:27)
這是庫的依賴關係結構從我gradle這個
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.google.code.gson:gson:2.4'
compile files('libs/azuresdk-android-2.0.3/mobileservices/guava-17.0.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3-javadoc.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3-sources.jar')
compile 'com.google.android.gms:play-services:8.4.0'
}
希望你能幫助我。提前致謝。
非常感謝你@Tim!我能夠解決這個問題。我只選擇了我需要的罐子。 –