谷歌地图加载时出错

时间:2016-11-05 06:30:13

标签: android google-maps

当我尝试开始任何地图活动时,我遇到了这个崩溃..

这是我的gradle依赖项: 依赖{     编译fileTree(包括:['* .jar'],dir:'libs')     testCompile'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.jakewharton:butterknife:7.0.1'
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.google.android.gms:play-services-location:8.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.google.code.gson:gson:2.7'

compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.onesignal:OneSignal:3.4.1'

compile 'com.wang.avi:library:1.0.3'
compile 'com.nineoldandroids:library:2.4.0'


}

这是logcat

11-05 10:00:19.603 10285-10285/com.wneet.white E/AndroidRuntime: FATAL EXCEPTION: main
                                                                 Process: com.wneet.white, PID: 10285
                                                                 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wneet.white/com.wneet.white.LoadingFirst}: java.lang.NullPointerException
                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519)
                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2578)
                                                                     at android.app.ActivityThread.access$900(ActivityThread.java:170)
                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                     at android.os.Looper.loop(Looper.java:146)
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5727)
                                                                     at java.lang.reflect.Method.invokeNative(Native Method)
                                                                     at java.lang.reflect.Method.invoke(Method.java:515)
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
                                                                     at dalvik.system.NativeStart.main(Native Method)
                                                                  Caused by: java.lang.NullPointerException
                                                                     at com.wneet.white.LoadingFirst.onCreate(LoadingFirst.java:88)
                                                                     at android.app.Activity.performCreate(Activity.java:5581)
                                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2483)
                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2578) 
                                                                     at android.app.ActivityThread.access$900(ActivityThread.java:170) 
                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) 
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                     at android.os.Looper.loop(Looper.java:146) 
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5727) 
                                                                     at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                     at java.lang.reflect.Method.invoke(Method.java:515) 
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) 
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) 
                                                                     at dalvik.system.NativeStart.main(Native Method) 

提前完成。

1 个答案:

答案 0 :(得分:0)

请检查并确保您能够使用兼容的Google Play服务SDK设置项目,如Setting Up Google Play Services中所述。如果您还没有安装Google Play服务SDK,请按照Adding SDK Packages指南进行操作。

blog postGitHub post中提供的解决方案也可能为您提供可行的解决方案,并可能提供帮助。