My app (targetSDK 31, using SPP Bluetooth) started having this issue in the pre-launch report of the Play console:
it seems to happen only on Pixel 2 (SDK 29)
and there's no reference to my package name in the whole stack trace
I'm puzzled at this...
B4X:
Exception Process: com.android.settings, PID: 8091
java.lang.RuntimeException: Failed to call observer method
at android.arch.lifecycle.ClassesInfoCache$MethodReference.invokeCallback (ClassesInfoCache.java:225)
at android.arch.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent (ClassesInfoCache.java:193)
at android.arch.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks (ClassesInfoCache.java:185)
at android.arch.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged (ReflectiveGenericLifecycleObserver.java:36)
at android.arch.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent (LifecycleRegistry.java:355)
at android.arch.lifecycle.LifecycleRegistry.forwardPass (LifecycleRegistry.java:293)
at android.arch.lifecycle.LifecycleRegistry.sync (LifecycleRegistry.java:333)
at android.arch.lifecycle.LifecycleRegistry.moveToState (LifecycleRegistry.java:138)
at android.arch.lifecycle.LifecycleRegistry.handleLifecycleEvent (LifecycleRegistry.java:124)
at com.android.settingslib.core.lifecycle.ObservablePreferenceFragment.onStart (ObservablePreferenceFragment.java:79)
at com.android.settings.dashboard.DashboardFragment.onStart (DashboardFragment.java:136)
at android.app.Fragment.performStart (Fragment.java:2548)
at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1334)
at android.app.FragmentManagerImpl.moveFragmentToExpectedState (FragmentManager.java:1576)
at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1637)
at android.app.FragmentManagerImpl.dispatchMoveToState (FragmentManager.java:3046)
at android.app.FragmentManagerImpl.dispatchStart (FragmentManager.java:3003)
at android.app.FragmentController.dispatchStart (FragmentController.java:193)
at android.app.Activity.performStart (Activity.java:7165)
at android.app.ActivityThread.handleStartActivity (ActivityThread.java:2937)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence (TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath (TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1808)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:193)
at android.app.ActivityThread.main (ActivityThread.java:6669)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:858)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.settingslib.bluetooth.LocalBluetoothManager.setForegroundActivity(android.content.Context)' on a null object reference
at com.android.settings.bluetooth.BluetoothDeviceUpdater.registerCallback (BluetoothDeviceUpdater.java:88)
at com.android.settings.connecteddevice.AvailableMediaDeviceGroupController.onStart (AvailableMediaDeviceGroupController.java:61)
at com.android.settingslib.core.lifecycle.Lifecycle.onStart (Lifecycle.java:120)
at com.android.settingslib.core.lifecycle.Lifecycle.access$100 (Lifecycle.java:54)
at com.android.settingslib.core.lifecycle.Lifecycle$LifecycleProxy.onLifecycleEvent (Lifecycle.java:218)
at java.lang.reflect.Method.invoke
at android.arch.lifecycle.ClassesInfoCache$MethodReference.invokeCallback (ClassesInfoCache.java:221)
it seems to happen only on Pixel 2 (SDK 29)
and there's no reference to my package name in the whole stack trace
I'm puzzled at this...