question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tap on map cause an app crash on android

See original GitHub issue

tns info

√ Getting NativeScript components versions information...
√ Component nativescript has 6.7.6 version and is up to date.
√ Component @nativescript/core has 6.5.8 version and is up to date.
√ Component tns-android has 6.5.1 version and is up to date.
√ Component tns-ios has 6.5.1 version and is up to date.

nativescript-mapbox: 5.0.1

if you tap lightly on the over side of the marker (default marker) ezgif com-video-to-gif

error

An uncaught Exception occurred on "main" thread.
Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference

StackTrace:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
	at com.tns.gen.com.mapbox.mapboxsdk.maps.MapboxMap_OnMapClickListener.onMapClick(MapboxMap_OnMapClickListener.java:19)
	at com.mapbox.mapboxsdk.maps.MapGestureDetector.notifyOnMapClickListeners(MapGestureDetector.java:983)
	at com.mapbox.mapboxsdk.maps.MapGestureDetector$StandardGestureListener.onSingleTapConfirmed(MapGestureDetector.java:358)
	at com.mapbox.android.gestures.StandardGestureDetector$1.onSingleTapConfirmed(StandardGestureDetector.java:81)
	at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:323)
	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)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
TPham92commented, Jul 8, 2020

@wendt88 I figured out the issue. If you uses setOnMapClickListener or setOnMapLongClickListener function you need to return a boolean. The new Mapbox Native SDK allows for multiple listeners on an event and follows the standard pattern of returning ‘true’ when a handler has handled the event and others shouldn’t. Not returning a boolean from the listener function will cause a crash. https://docs.mapbox.com/android/api/map-sdk/9.2.0/index.html

EX: mapbox.setOnMapClickListener((point: LatLng) => { console.log("Map clicked at latitude: " + point.lat + ", longitude: " + point.lng); // do stuff ... return true });

2reactions
Yermocommented, Jul 6, 2020

I haven’t had a chance to look at it. At my present rate of progress I’ll be making another major pass through the plugin in early August.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Maps when it crashes - Android - Google Maps Help
Go to Settings and then Apps. · Select Maps app. · Tap Storage and then Clear data.
Read more >
Top 8 Ways to Fix Google Maps Keeps Crashing on Android
Long-press on the Google Maps icon and select the App info. That'll take you to App Settings. Tap on Force stop and hit...
Read more >
How To Fix Google Maps Keeps Crashing On Android Device
Fix #4 Clear app data and clear cache​​ The Google Maps crashing issue can be cause by a corrupted cached files. Google Maps...
Read more >
Why do my apps keep crashing on Android, How to fix it
One reason could be low memory or a weak chipset. Apps can also crash if they are not coded properly. Sometimes the reason...
Read more >
Solved: How do I fix Google Maps Android App Crashes, Not ...
Step 1: Go to Settings > Apps & notifications. Step 2: Swipe left until you find the All tab. Step 3: Scroll down...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found