Google マップ用の Android 互換性ライブラリ ( https://github.com/petedoyle/android-support-v4-googlemaps ) を使用するアプリをリリースしましたが、奇妙な「アクティビティを開始できません」というクラッシュ レポートを受け取りました。
以下にいくつかのサンプル スタック トレースを貼り付けました。Google マップの Android 互換性ライブラリを使用して、または標準の Android 互換性ライブラリ ( http://developer.android.com/sdk/compatibility-library.html ) を使用して、これを経験した人はいますか? このエラーを克服する方法を知っている人はいますか?
----- スタックトレース例 1 -----
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.myapp/com.mycompany.myapp.activities.GameActivity}: java.lang.NullPointerException
...
caused by java.lang.NullPointerException
at android.app.ContextImpl.openFileOutput(ContextImpl.java:430)
at android.content.ContextWrapper.openFileOutput(ContextWrapper.java:158)
at com.google.common.io.android.AndroidPersistentStore.writeBlockX(Unknown Source)
at com.google.common.io.android.AndroidPersistentStore.writeBlock(Unknown Source)
at com.google.common.io.PreferenceStore.ensurePreferencesLoaded(Unknown Source)
at com.google.common.io.PreferenceStore.readPreference(Unknown Source)
at com.google.common.io.BasePersistentStore.readPreference(Unknown Source)
at com.google.common.StaticUtil.readPreferenceAsDataInput(Unknown Source)
at com.google.googlenav.datarequest.DataRequestDispatcher.loadOrRequestCookie(Unknown Source)
at com.google.googlenav.datarequest.DataRequestDispatcher.<init>(Unknown Source)
at com.google.googlenav.datarequest.DataRequestDispatcher.createInstance(Unknown Source)
at com.google.android.maps.MapActivity.createMap(MapActivity.java:509)
at com.google.android.maps.MapActivity.onCreate(MapActivity.java:409)
at android.support.v4.app.FragmentActivity.onCreate(Unknown Source)
at com.mycompany.myapp.activities.GameActivity.onCreate(Unknown Source)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
----- スタックトレース例 2 -----
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.myapp/com.mycompany.myapp.activities.GameActivity}: java.lang.NullPointerException
...
Caused by: java.lang.NullPointerException
at android.app.ContextImpl.openFileOutput(ContextImpl.java:423)
at android.content.ContextWrapper.openFileOutput(ContextWrapper.java:158)
at android_maps_conflict_avoidance.com.google.common.io.android.AndroidPersistentStore.writeBlockX(AndroidPersistentStore.java:140)
at android_maps_conflict_avoidance.com.google.common.io.android.AndroidPersistentStore.writeBlock(AndroidPersistentStore.java:169)
at android_maps_conflict_avoidance.com.google.common.io.PreferenceStore.ensurePreferencesLoaded(PreferenceStore.java:178)
at android_maps_conflict_avoidance.com.google.common.io.PreferenceStore.readPreference(PreferenceStore.java:86)
at android_maps_conflict_avoidance.com.google.common.io.BasePersistentStore.readPreference(BasePersistentStore.java:41)
at android_maps_conflict_avoidance.com.google.common.StaticUtil.readPreferenceAsDataInput(StaticUtil.java:271)
at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.loadOrRequestCookie(DataRequestDispatcher.java:493)
at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.<init>(DataRequestDispatcher.java:390)
at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.createInstance(DataRequestDispatcher.java:341)
at com.google.android.maps.MapActivity.createMap(MapActivity.java:548)
at com.google.android.maps.MapActivity.onCreate(MapActivity.java:422)
at android.support.v4.app.FragmentActivity.onCreate(Unknown Source)
at com.mycompany.myapp.activities.GameActivity.onCreate(Unknown Source)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1709)