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.

Zoom Button Crash in 6.1.0

See original GitHub issue

Issue Type

[X] Bug

Description and/or steps/code to reproduce the problem

Plugging 6.1.0 into gradle to replace 6.0.3 in my App, all things so far seem fine. All but the (standard) zoom buttons: These bottons relyably crash 100% of the time after app start. With plenty of stack trace which all seem repeations of this (one click creates hundreds and so far I only checked manually):

2019-03-25 09:26:07.704 ? E/AndroidRuntime:     at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
2019-03-25 09:26:07.704 ? E/AndroidRuntime:     at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.end(ValueAnimator.java:1133)
        at org.osmdroid.views.MapController.animateTo(MapController.java:167)
        at org.osmdroid.views.MapController.animateTo(MapController.java:137)
        at org.osmdroid.views.MapController.animateTo(MapController.java:183)
        at org.osmdroid.views.MapController.animateTo(MapController.java:129)
        at org.osmdroid.views.MapView.setZoomLevel(MapView.java:492)
        at org.osmdroid.views.MapController$MapAnimatorListener.onAnimationUpdate(MapController.java:520)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1547)
        at android.animation.ValueAnimator.animateBasedOnTime(ValueAnimator.java:1339)
        at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1471)
        at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
        at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
        at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1170)
        at android.view.Choreographer.doCallbacks(Choreographer.java:984)
        at android.view.Choreographer.doFrame(Choreographer.java:806)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1158)
        at android.os.Handler.handleCallback(Handler.java:873)
2019-03-25 09:26:07.704 ? E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6863)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Once the user has done some manual (gesture or in my App location bookmarks) zooming or location change, this does not happen any more. But when the user hits zoom directly after start it crashes relyably.

The stack traces seem to depend on Android version, on Android 4.2.2 I get the following:

03-25 09:42:27.976 de.spieleck.app.badgers.debug E/AndroidRuntime: FATAL EXCEPTION: main java.lang.StackOverflowError

(which matches to the amount of output on Android 9 where log is just to fast to keep the start of problems in Android Studio memory).

Environment

My Badge®s App, Android 4.2.2, 9 checked here

If it’s a bug, version(s) of android this affects:

A9, 4.2.2

Version of osmdroid the issue relates to:

6.1.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:39 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
spyhunter99commented, Mar 30, 2019

if we are all in concur on this, i can merge and get a new version rolled out today or tomorrow

1reaction
pasniakcommented, May 24, 2019

Success today!

The issue is related to any app having a Snappable overlay (an OwnLocationOverlay):

This code in setZoomLevel https://github.com/osmdroid/osmdroid/blob/8bcb806f8d763e4a1e36813c8ac6b7e763cb2b6f/osmdroid-android/src/main/java/org/osmdroid/views/MapView.java#L500 gets true from onSnapItem https://github.com/osmdroid/osmdroid/blob/832e0813d394e83106c5cdc3beb642d38d5dbade/osmdroid-android/src/main/java/org/osmdroid/views/overlay/DefaultOverlayManager.java#L270 and continuously calls animateTo leading to SO:

			if (this.getOverlayManager().onSnapToItem((int) mMultiTouchScaleInitPoint.x,
					(int) mMultiTouchScaleInitPoint.y, snapPoint, this)) {
				IGeoPoint geoPoint = pj.fromPixels(snapPoint.x, snapPoint.y, null, false);
				getController().animateTo(geoPoint);
			}

and onSnapItem:

    public boolean onSnapToItem(final int x, final int y, final Point snapPoint, final IMapView pMapView) {
        for (final Overlay overlay : this.overlaysReversed()) {
            if (overlay instanceof Snappable) {
                if (((Snappable) overlay).onSnapToItem(x, y, snapPoint, pMapView)) {
                    return true;

I could repro stack overflow by hardcoding return true; in onSnapToItem; patch this below.and zoom out to stack overflow at will in Osmdroid-android test app!

Index: osmdroid-android/src/main/java/org/osmdroid/views/overlay/DefaultOverlayManager.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- osmdroid-android/src/main/java/org/osmdroid/views/overlay/DefaultOverlayManager.java	(revision b6ea341a9bc2658011f827f57edeaf3baea51fc8)
+++ osmdroid-android/src/main/java/org/osmdroid/views/overlay/DefaultOverlayManager.java	(date 1558697029000)
@@ -265,11 +265,12 @@
     @Override
     public boolean onSnapToItem(final int x, final int y, final Point snapPoint, final IMapView pMapView) {
         for (final Overlay overlay : this.overlaysReversed()) {
-            if (overlay instanceof Snappable) {
-                if (((Snappable) overlay).onSnapToItem(x, y, snapPoint, pMapView)) {
-                    return true;
-                }
-            }
+//            if (overlay instanceof Snappable) {
+//                if (((Snappable) overlay).onSnapToItem(x, y, snapPoint, pMapView)) {
+//                    return true;
+//                }
+//            }
+            return true;
         }
 
         return false;
Read more comments on GitHub >

github_iconTop Results From Across the Web

Tapping the More menu button in the Zoom meeting screen ...
Tapping the More menu button in the Zoom meeting screen causes the app to crash · Go to the app · Click on...
Read more >
19154 (Using VMSVGA crashes VirtualBoxVM.exe)
VBox.log with a crash when running zoom.us in chrome/chromium ... When the 3D acceleration is off, the display lag whenever I switch from...
Read more >
Smokeview Release Notes - NIST Pages
enhancement: Use the middle mouse button to zoom the scene in and out and the right mouse button (after M key is pressed...
Read more >
iOS SDK Release Notes - Meridian Platform Documentation
Fixed: The default placemark zoom levels match iOS now. Fixed: The Directions and Show My Location buttons weren't vertically aligned. They are ...
Read more >
Jitsi Android SDK crashes (version 6.1.0) after joining call
I had same problem, i tried to use older version sdk:5.1.0 and enable Jetfier . It fixed my issue. Go to Gradle.properties add...
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