Google Maps SDK(v2)を使用する私のアプリは、次の例外でクラッシュし始めました:
Process: com.currentlocation.Android, PID: 7328
Java.lang.ArrayIndexOutOfBoundsException: length=1; index=12
at com.google.maps.api.Android.lib6.gmm6.vector.ct.<init>(:com.google.Android.gms.dynamite_mapsdynamite@[email protected] (120400-0):9)
at com.google.maps.api.Android.lib6.gmm6.vector.cv.a(:com.google.Android.gms.dynamite_mapsdynamite@[email protected] (120400-0):23)
at com.google.maps.api.Android.lib6.gmm6.util.m.run(:com.google.Android.gms.dynamite_mapsdynamite@[email protected] (120400-0):14)
at Java.lang.Thread.run(Thread.Java:919)
V3ベータSDKでは、スタックトレースは次のとおりです。
2020-04-23 15:59:06.064 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example, PID: 22717
Java.lang.ArrayIndexOutOfBoundsException: length=1; index=12
at com.google.Android.libraries.maps.bv.zzbs.<init>(ZoomTable.Java:24)
at com.google.Android.libraries.maps.bv.zzbv.zza(ZoomTableQuadTree.Java:57)
at com.google.Android.libraries.maps.br.zzd.zza(Unknown Source:4)
at com.google.Android.libraries.maps.hi.zzas.zza(Suppliers.Java:7)
at com.google.Android.libraries.maps.br.zza.zzh(SharedMapComponentImpl.Java:58)
at com.google.Android.libraries.maps.gu.zzat.zza(RendererFactoryImpl.Java:88)
at com.google.Android.libraries.maps.it.zzav.zza(GoogleMapImpl.Java:59)
at com.google.Android.libraries.maps.it.zzci.zza(MapFragmentDelegateImpl.Java:3)
at com.google.Android.libraries.maps.it.zzcg.zza(MapFragmentDelegateImpl.Java:15)
at com.google.Android.libraries.maps.SupportMapFragment$zza.onCreateView(SupportMapFragment.Java:15)
at com.google.Android.gms.dynamic.zae.zaa(com.google.Android.gms:play-services-base@@17.1.0:4)
at com.google.Android.gms.dynamic.DeferredLifecycleHelper.zaa(com.google.Android.gms:play-services-base@@17.1.0:9)
at com.google.Android.gms.dynamic.DeferredLifecycleHelper.onCreateView(com.google.Android.gms:play-services-base@@17.1.0:25)
at com.google.Android.libraries.maps.SupportMapFragment.onCreateView(SupportMapFragment.Java:34)
at androidx.fragment.app.Fragment.performCreateView(Fragment.Java:2698)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.Java:310)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.Java:1185)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.Java:1354)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.Java:1432)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.Java:1495)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.Java:2617)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.Java:2569)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.Java:2722)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.Java:336)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.Java:1186)
at androidx.fragment.app.FragmentManager.addAddedFragments(FragmentManager.Java:2222)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.Java:1995)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.Java:1951)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.Java:1847)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.Java:2621)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.Java:2569)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.Java:2722)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.Java:336)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.Java:1186)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.Java:1354)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.Java:1432)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.Java:1495)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.Java:2617)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.Java:2569)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.Java:247)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.Java:541)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.Java:201)
at Android.app.Instrumentation.callActivityOnStart(Instrumentation.Java:1432)
at Android.app.Activity.performStart(Activity.Java:7848)
at Android.app.ActivityThread.handleStartActivity(ActivityThread.Java:3294)
2020-04-23 15:59:06.064 E/AndroidRuntime: at Android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.Java:221)
at Android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.Java:201)
at Android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.Java:173)
at Android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.Java:97)
at Android.app.ActivityThread$H.handleMessage(ActivityThread.Java:2016)
at Android.os.Handler.dispatchMessage(Handler.Java:107)
at Android.os.Looper.loop(Looper.Java:214)
at Android.app.ActivityThread.main(ActivityThread.Java:7356)
at Java.lang.reflect.Method.invoke(Native Method)
at com.Android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.Java:492)
at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:930)
原因は何ですか?
推奨される回避策は1回のみ機能します:
Google Map Zoom Data Corruptedに関するサイレントプッシュ通知をアプリに送信するか、APIマップを呼び出してGoogle Map Zoom Dataのステータスを確認することをお勧めします。これを毎回不要なサーバーコールと考える場合は、プッシュ通知を使用してこのロジックをトリガーするか、サーバーのステータスを確認する既存のコールの1つと統合できます。これをアプリ固有のロジックに任せます。そうすることで、Googleマップが再びこのエラーをスローした場合、回避策を再トリガーできます。
サーバー呼び出しの場合、これはすべてのユーザーのZoomDataをリセットします。プッシュ通知の場合、一部のユーザーに通知を送信できます。
fun receivedPushNotificationZoomDataCorrupted() {
try {
val corruptedZoomTables = File(filesDir, "ZoomTables.data")
val corruptedSavedClientParameters = File(filesDir, "SavedClientParameters.data.cs")
val corruptedClientParametersData = File(filesDir, "DATA_ServerControlledParametersManager.data.v1.${packageName}")
corruptedZoomTables.delete()
corruptedSavedClientParameters.delete()
corruptedClientParametersData.delete()
}
} catch (exception: Exception) {
}
}