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

My Places: OSM Edits: Upper Right Upload Button: Application Consistently Restarts #20109

Closed
Zian opened this issue Jun 15, 2024 · 1 comment · Fixed by #20163
Closed

My Places: OSM Edits: Upper Right Upload Button: Application Consistently Restarts #20109

Zian opened this issue Jun 15, 2024 · 1 comment · Fixed by #20163
Assignees
Labels
Milestone

Comments

@Zian
Copy link

Zian commented Jun 15, 2024

Steps to Reproduce the Problem:

  1. Start OsmAnd.
  2. Press the hamburger menu button in the lower left corner.
  3. Press My Places.
  4. Press "OSM EDITS" if the list of pending edits is not visible. On my device, 5 items are shown under "Your edits".
  5. Press the upload button in the lower left corner.
  6. Check all the check boxes by pressing the checkbox to the left of "Your edits".
  7. Press the upload button in the upper right corner.

Expected Result:
The items should be uploaded.

Actual Result:
OsmAnd crashes. After the application restarts, it prompts me to e-mail a log file.

Most Recent Entry in exception.log:

Version  OsmAnd+ 4.7.17
15.06.2024 11:40:51
Apk Version : 4.7.17 4717
Exception occurred in thread Thread[AsyncTask #144,5,main] : 
java.lang.RuntimeException: An error occurred while executing doInBackground()
	at android.os.AsyncTask$3.done(AsyncTask.java:354)
	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
	at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
	at java.util.concurrent.FutureTask.run(FutureTask.java:271)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.RuntimeException: Can't toast on a thread that has not called Looper.prepare()
	at android.widget.Toast$TN.<init>(Toast.java:393)
	at android.widget.Toast.<init>(Toast.java:117)
	at android.widget.Toast.makeText(Toast.java:280)
	at android.widget.Toast.makeText(Toast.java:270)
	at net.osmand.plus.plugins.osmedit.helpers.OpenstreetmapRemoteUtil.loadEntity(OpenstreetmapRemoteUtil.java:442)
	at net.osmand.plus.plugins.osmedit.asynctasks.UploadOpenstreetmapPointAsyncTask.doInBackground(UploadOpenstreetmapPointAsyncTask.java:71)
	at net.osmand.plus.plugins.osmedit.asynctasks.UploadOpenstreetmapPointAsyncTask.doInBackground(UploadOpenstreetmapPointAsyncTask.java:23)
	at android.os.AsyncTask$2.call(AsyncTask.java:333)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	... 3 more

Environmental Information:

  • OsmAnd Version: 4.7.17
  • Full Name: net.osmand.plus
  • OnePlus 5
  • Android version 9
@vshcherb vshcherb added this to the 4.8-android milestone Jun 17, 2024
@vshcherb
Copy link
Member

vshcherb commented Jun 17, 2024

ToDo

  • Toasts should be displayed in PostExecute (not in DoBackground as it's now)
			public void uploadEnded(Map<OsmPoint, String> loadErrorsMap) {

Reproducing is not necessary code should be changed

@osmandapp osmandapp deleted a comment from DmitryAlexei Jun 21, 2024
@Corwin-Kh Corwin-Kh self-assigned this Jun 24, 2024
@Corwin-Kh Corwin-Kh linked a pull request Jun 24, 2024 that will close this issue
Chumva added a commit that referenced this issue Jun 24, 2024
#20109: Fixed calling show toast from worker thread
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