webentwicklung-frage-antwort-db.com.de

AndroidRuntime: FATAL EXCEPTION: androidmapsapi-ZoomTableManager

Meine App, die Google Maps SDK (v2) verwendet, stürzte gerade mit dieser Ausnahme ab:

Process: com.currentlocation.Android, PID: 7328
    Java.lang.ArrayIndexOutOfBoundsException: length=1; index=12
        at com.google.maps.api.Android.lib6.gmm6.vector.ct.<init>(:[email protected]@20.12.16 (120400-0):9)
        at com.google.maps.api.Android.lib6.gmm6.vector.cv.a(:[email protected]@20.12.16 (120400-0):23)
        at com.google.maps.api.Android.lib6.gmm6.util.m.run(:[email protected]@20.12.16 (120400-0):14)
        at Java.lang.Thread.run(Thread.Java:919)

Im Beta-SDK der Version 3 lautet der Stack-Trace:

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:[email protected]@17.1.0:4)
        at com.google.Android.gms.dynamic.DeferredLifecycleHelper.zaa(com.google.Android.gms:[email protected]@17.1.0:9)
        at com.google.Android.gms.dynamic.DeferredLifecycleHelper.onCreateView(com.google.Android.gms:[email protected]@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)

Was ist die Ursache?

160
Prem Chand

Die vorgeschlagene Problemumgehung funktioniert nur einmal :

Ich empfehle, Ihrer App eine stille Push-Benachrichtigung über beschädigte Google Map-Zoomdaten zu senden oder einen API-Aufruf durchzuführen, um den Status der Google Map-Zoomdaten zu überprüfen. Wenn Sie dies jedes Mal als unnötigen Serveraufruf betrachten, können Sie diese Logik entweder mithilfe der Push-Benachrichtigung auslösen oder in einen Ihrer vorhandenen Aufrufe integrieren, in denen Sie den Status Ihrer Server überprüfen. Überlassen Sie dies Ihrer app-spezifischen Logik. Wenn Google Maps diesen Fehler erneut ausgibt, können Sie Ihre Problemumgehung erneut auslösen.

Wenn der Server anruft, werden ZoomData für alle Benutzer zurückgesetzt. Bei Push-Benachrichtigungen können Sie Benachrichtigungen an einige Benutzer senden.


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) {

 }
} 


0
Sreeram Sunkara