Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when trying to add address in overlay mode #5177

Closed
deevroman opened this issue Aug 7, 2023 · 11 comments · Fixed by #5200
Closed

Crash when trying to add address in overlay mode #5177

deevroman opened this issue Aug 7, 2023 · 11 comments · Fixed by #5200
Labels

Comments

@deevroman
Copy link

How to Reproduce

  1. Turn on address overlay
  2. Tilt the map
  3. Tap +
  4. Crash
Screen_Recording_20230807_140011_One.UI.Home.mp4

Versions affected
StreetComplete 53.3 Android 13 OneUI 5.1 Samsung Galaxy A52

@deevroman deevroman added the bug label Aug 7, 2023
@westnordost
Copy link
Member

Does it only crash if you tilt the map? You use the Google Play version of the app?

@deevroman
Copy link
Author

deevroman commented Aug 7, 2023

Does it only crash if you tilt the map?

I've occasionally encountered a crash when enabling the overlay, but I can't reproduce it.

You use the Google Play version of the app?

Yes. If logs are needed, I can use adb

@westnordost
Copy link
Member

You use the Google Play version of the app?

Yes. If logs are needed, I can use adb

The stack trace would be most helpful

@westnordost
Copy link
Member

Can reproduce

FATAL EXCEPTION: main
Process: de.westnordost.streetcomplete.debug, PID: 22946
java.lang.NullPointerException
	at de.westnordost.streetcomplete.overlays.AbstractOverlayForm.getGeometry(AbstractOverlayForm.kt:126)
	at de.westnordost.streetcomplete.overlays.AbstractOverlayForm.get_countryInfo(AbstractOverlayForm.kt:89)
	at de.westnordost.streetcomplete.overlays.AbstractOverlayForm.getCountryInfo(AbstractOverlayForm.kt:95)
	at de.westnordost.streetcomplete.overlays.address.AddressOverlayForm.onViewCreated(AddressOverlayForm.kt:154)
	at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3147)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:588)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1839)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
	at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:565)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7918)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

For the country's locale, the form needs to know the geo-position of wherever the crosshair is pointing. Tangram-es however returns null, i.e. it can for one reason or another not determine the position of where the crosshais is pointing at...

So, I am not sure how we can workaround that. The geo-position is necessary to show the form (and to place the new address, after all). If it is not available... and the overlay form fragment has to be already opened because it contains the crosshair, i.e. the screen position that should be translated to the geo-position.

@Helium314
Copy link
Collaborator

For me the crash happens only very close to the maximum allowed tilt.
Maybe maximum tilt could be slightly reduced as a workaround?

@westnordost
Copy link
Member

Does it happen for you only at almost maximum allowed tilt, @deevroman ?

@deevroman
Copy link
Author

Indeed, if you return the tilt quite a bit after the maximum tilt, there is no crash.

@westnordost
Copy link
Member

What would you estimate, percentage-wise. How much do you have to return it?

@deevroman
Copy link
Author

deevroman commented Aug 15, 2023

Very little. I'll put it another way: if there is no shaking of the map at the end of the tilt, then there is no crash. (This shaking can even be seen a little bit in the video.)

@Helium314
Copy link
Collaborator

Crashes with tilt PI / 6 + 0.15, works with tilt PI / 6 + 0.1.

@westnordost
Copy link
Member

Looks like a good workaround for me then.

westnordost added a commit that referenced this issue Aug 17, 2023
* set and enforce a maximum tilt (fixes #5177)

* oh well, just use 60° as before

(let's not change behavior while fixing an issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants