在某些设备上的MapView / MapActivity崩溃 [英] MapView / MapActivity crash on some devices

查看:169
本文介绍了在某些设备上的MapView / MapActivity崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过谷歌的图形页面教程走了,它工作正常,在模拟器上和例如在我的HTC Flyer的。但由于某些原因,我的手机(三星Galaxy I9000)上启动时,它会立即崩溃。

I have gone through Google's MapView tutorial and it works fine on the emulator and for example on my HTC Flyer. But for some reason it immediately crashes when starting it on my mobile phone (Samsung Galaxy I9000).

的崩溃发生在那里,因为就在一开始捆绑的onCreate()接收为空。我对编译的Andr​​oid 2.3.3。这是安装在手机上也是如此。该传单采用Android 3.0

The crash happens there, because right at the beginning the Bundle that onCreate() receives is null. I'm compiling against Android 2.3.3. This is installed on the phone as well. The Flyer uses Android 3.0

我会非常AP preciate对这个奇怪的问题的任何帮助。

I'd greatly appreciate any help on this weird issue.

这是excact logcat的输出:

This is the excact Logcat output:

04-18 10:52:26.019: E/AndroidRuntime(1461): FATAL EXCEPTION: main
04-18 10:52:26.019: E/AndroidRuntime(1461): java.lang.RuntimeException: Unable to start activity ComponentInfo{bernd.konnerth/bernd.konnerth.HelloMapViewActivity}: java.lang.NullPointerException
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.os.Looper.loop(Looper.java:123)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.app.ActivityThread.main(ActivityThread.java:3687)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at java.lang.reflect.Method.invokeNative(Native Method)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at java.lang.reflect.Method.invoke(Method.java:507)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at dalvik.system.NativeStart.main(Native Method)
04-18 10:52:26.019: E/AndroidRuntime(1461): Caused by: java.lang.NullPointerException
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.app.ContextImpl.openFileOutput(ContextImpl.java:495)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.content.ContextWrapper.openFileOutput(ContextWrapper.java:158)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android_maps_conflict_avoidance.com.google.common.io.android.AndroidPersistentStore.writeBlockX(AndroidPersistentStore.java:140)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android_maps_conflict_avoidance.com.google.common.io.android.AndroidPersistentStore.writeBlock(AndroidPersistentStore.java:169)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android_maps_conflict_avoidance.com.google.common.io.PreferenceStore.ensurePreferencesLoaded(PreferenceStore.java:178)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android_maps_conflict_avoidance.com.google.common.io.PreferenceStore.readPreference(PreferenceStore.java:86)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android_maps_conflict_avoidance.com.google.common.io.BasePersistentStore.readPreference(BasePersistentStore.java:41)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android_maps_conflict_avoidance.com.google.common.StaticUtil.readPreferenceAsDataInput(StaticUtil.java:271)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.loadOrRequestCookie(DataRequestDispatcher.java:493)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.<init>(DataRequestDispatcher.java:390)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.createInstance(DataRequestDispatcher.java:341)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at com.google.android.maps.MapActivity.createMap(MapActivity.java:548)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at com.google.android.maps.MapActivity.onCreate(MapActivity.java:422)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at bernd.konnerth.HelloMapViewActivity.onCreate(HelloMapViewActivity.java:15)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-18 10:52:26.019: E/AndroidRuntime(1461):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
04-18 10:52:26.019: E/AndroidRuntime(1461):     ... 11 more

谢谢,
贝恩德

Thanks, Bernd

推荐答案

我知道了!你猜怎么了!它是重要的包名!

I got it! Guess what! It's the package name that matters!!!

我发现在谷歌地图样本:

I found a Google Map sample in:

C:\\ Android的SDK \\插件\\插件 - google_apis-google_inc_-10 \\样本\\ MapsDemo

然后我剥夺它,直到它几乎等同于我的。我使用的 bernd.konnerth 作为包名。但对于一些真正疯狂的原因,显然三星手机(也可能是其它设备一样)不接受,只是抛出在发射NullPointerException异常,没有任何进一步暗示可能指向包的名称问题。

then I stripped it down until it was nearly identical to my one. I was using bernd.konnerth as the package name. But for some really crazy reason, obviously the Samsung phone (and probably other devices as well) does not accept that and simply throws a NullPointerException at launch, without any further hint that could point to the package name issue.

当我使用 com.bernd.konnerth 一切工作正常。显然,必须有一个融为一体。在前面。但要注意!似乎有进一步的名字组合不工作。一次偶然的机会我发现,例如 com.android.wifi 行不通的!甚至认为这个包好像没有在android系统命名空间存在。

When I use com.bernd.konnerth everything works fine. Obviously there must be a com. in front. But be warned! There seem to be further name combinations that don't work. By chance I found out that for example com.android.wifi doesn't work as well! Even thought this package does NOT seem to exist in android namespace.

这样的事情能够真正开车的人疯了! : - (

Such things can really drive people crazy! :-(

不过谢谢你的回复速度快的!

Nevertheless thanks for all of your fast replies!

贝恩德

这篇关于在某些设备上的MapView / MapActivity崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆