Page MenuHomeGitPull.it

Fix crash on map caused by LocationComponentNotInitializedException in MapLibreFragment.kt:662 on version 2.5.1-gitdev while pressing the back button on the map (2026-05-12)
Closed, DuplicatePublic

Description

Dear Developers of the amazing Free/Libre and Open Source app Libre BusTO,
Please triage my crash:

Version code:
74

Version name:
2.5.1

Android version:
11

Phone:
Mi A3

Brand:
Xiaomi

Stack:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
	at android.widget.Toast.makeText(Toast.java:519)
	at it.reyboz.bustorino.fragments.MapLibreFragment$requestInitialUserLocation$1.onLocationChanged(MapLibreFragment.kt:662)
	at android.location.LocationManager$LocationListenerTransport.acceptLocation(LocationManager.java:2761)
	at android.location.LocationManager$LocationListenerTransport.lambda$enkW18B0WwpQkSIMmVChmQ2YwC8(Unknown Source:0)
	at android.location.-$$Lambda$LocationManager$LocationListenerTransport$enkW18B0WwpQkSIMmVChmQ2YwC8.accept(Unknown Source:6)
	at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:292)
	at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:201)
	at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:97)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7698)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)


logcat (last 30 lines):
05-12 15:32:18.263 I/BusTO:MatoTripDownWRK(21453): Result download, so far, trips: 99, failed: 0, succeded: 21
05-12 15:32:18.318 I/BusTO:MatoTripDownWRK(21453): Result download, so far, trips: 99, failed: 0, succeded: 22
05-12 15:32:18.370 I/BusTO:MatoTripDownWRK(21453): Result download, so far, trips: 99, failed: 0, succeded: 23
05-12 15:32:18.419 I/BusTO:MatoTripDownWRK(21453): Result download, so far, trips: 99, failed: 0, succeded: 24
05-12 15:32:18.463 I/BusTO:MatoTripDownWRK(21453): Result download, so far, trips: 99, failed: 0, succeded: 25
05-12 15:32:18.508 I/BusTO:MatoTripDownWRK(21453): Result download, so far, trips: 99, failed: 0, succeded: 26
05-12 15:32:18.556 I/BusTO:MatoTripDownWRK(21453): Result download, so far, trips: 99, failed: 0, succeded: 27
05-12 15:32:18.558 D/BusTO:NearPositListen(21453): can start request for stops: true
05-12 15:32:18.573 D/BusTO-NearbyStopVwModel(21453): Setting value of stops in bounding box
05-12 15:32:18.582 D/AndroidRuntime(21453): Shutting down VM
--------- beginning of crash
05-12 15:32:18.583 E/AndroidRuntime(21453): FATAL EXCEPTION: main
05-12 15:32:18.583 E/AndroidRuntime(21453): Process: it.reyboz.bustorino, PID: 21453
05-12 15:32:18.583 E/AndroidRuntime(21453): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at android.widget.Toast.makeText(Toast.java:519)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at it.reyboz.bustorino.fragments.MapLibreFragment$requestInitialUserLocation$1.onLocationChanged(MapLibreFragment.kt:662)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at android.location.LocationManager$LocationListenerTransport.acceptLocation(LocationManager.java:2761)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at android.location.LocationManager$LocationListenerTransport.lambda$enkW18B0WwpQkSIMmVChmQ2YwC8(Unknown Source:0)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at android.location.-$$Lambda$LocationManager$LocationListenerTransport$enkW18B0WwpQkSIMmVChmQ2YwC8.accept(Unknown Source:6)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:292)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:201)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:97)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at android.os.Handler.handleCallback(Handler.java:938)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at android.os.Handler.dispatchMessage(Handler.java:99)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at android.os.Looper.loop(Looper.java:223)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at android.app.ActivityThread.main(ActivityThread.java:7698)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at java.lang.reflect.Method.invoke(Native Method)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
05-12 15:32:18.583 E/AndroidRuntime(21453): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)

Thank you! :)

What the user was doing:

ho aperto la posizione di una fermata sulla mappa e sono tornato indietro asd

Generated with https://lab.reyboz.it/libre-busto/crash-report/ (P15)

Details

Reported By (original)
lvps