Closed plcp closed 4 years ago
Thanks for the helpful report.
This is an interesting one. The good news is that the file itself is completely OK and I actually loaded it in to Vespucci without any problems at all.
The issue seems to be with Android internal file handling aka SAF. Could you try renaming the file? And if that doesn't work moving (perhaps copying it would be better) it to the Vespucci directory? See also https://github.com/MarcusWolschon/osmeditor4android/issues/1032
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9340, result=-1, data=Intent { dat=content://com.android.providers.downloads.documents/document/raw:/storage/emulated/0/Download/20_51_2000-EPSG-3857.mbtiles flg=0x43 }} to activity {de.blau.android/de.blau.android.prefs.PrefEditor}: java.lang.NumberFormatException: For input string: "raw:/storage/emulated/0/Download/20_51_2000-EPSG-3857.mbtiles"
at android.app.ActivityThread.deliverResults(ActivityThread.java:4506)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4548)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1916)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6898)
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)
Caused by: java.lang.NumberFormatException: For input string: "raw:/storage/emulated/0/Download/20_51_2000-EPSG-3857.mbtiles"
at java.lang.Long.parseLong(Long.java:594)
at java.lang.Long.valueOf(Long.java:808)
at de.blau.android.util.aj.a(SelectFile.java:239)
at de.blau.android.util.q.a(FileUtil.java:122)
at de.blau.android.resources.TileLayerDialog$2$1.a(TileLayerDialog.java:173)
at de.blau.android.util.aj.a(SelectFile.java:180)
at de.blau.android.prefs.f.onActivityResult(PrefEditorActivity.java:80)
at android.app.Activity.dispatchActivityResult(Activity.java:7476)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4499)
... 11 more
Stackoverflow finds https://stackoverflow.com/questions/51136671/oreo-documentscontract-getdocumentiduri-returns-path-instead-of-long
Potentially fixed in https://github.com/MarcusWolschon/osmeditor4android/commit/cd8736fd704546aa360047edd54b034597f82bdb
If you are willing to try a debug build (will require deinstalling the google play version) I'll upload one for you to test.
Renaming the file reproduce the problem, moving the file from /sdcard/Downloads
to the existing /sdcard/Vespucci
solves the problem. I'm open to try a debug build if this can help you to improve Vespucci
.
Nonetheless, thank you for fixing my problem !
The problem is that I can't recreate the problem here, so I don't really have a way of knowing if I fixed the underlying issue or not. How did you download/load the mbtiles file on to your device?
I've uploaded the file to a personal hosting service and downloaded it via HTTP using firefox
then tried to open it in Vespucci. I've subsequently tried with other files generated in different ways and all were failing while they were in the Downloads
directory.
Cutting & pasting them into the Vespucci
directory created by the application fixes the problem, and in the same manner cutting & pasting them into the Movies
directory works too. Trying several other directories works too, however putting it back inside the Downloads
directory reproduce the issue.
I'm available to install any build you'll provide me and try to import the file from the Downloads
directory.
(I can freely remove/reinstall the application several times without suffering data loss, I already backuped ongoing work)
"Firefox" was the missing bit of information, seems as if it stores files differently in the Downloads directory than Chrome/the standard browser (differently and undocumented). In any case with FF I can recreate the issue and confirm that the fix actually works.
Thanks for the support.
Vespucci Version
Both
14.0.17
and14.1.0 BETA
Download source
From Google Play Store
Behaviour/Symptoms
Going to preferences, custom layers, then loading a custom imagery from a
.mbtiles
file causes a crash of the application.Expected Behaviour
Layer is loaded and no crash is encountered.
How to recreate
Load
.mbtiles
file causing the crash.Crash dump submitted (no or yes + date)
Yes + 04/03/2020 between 18h10 and 18h20
Any other potentially relevant information
For more completeness, I'm quite a novice and generated the
.mbtiles
file usingGDAL
following this tutorial where20_51_2000.tif
is a georeferenced scan:Here is some
gdalinfo 20_51_2000-EPSG-3857.mbtiles
output: