andreynovikov / trekarta

Simple, responsive map for your trek. You decide how to journey today, not the application!
https://trekarta.info
GNU General Public License v3.0
174 stars 25 forks source link

App does not open - Android 11 #132

Closed duggalsu closed 7 months ago

duggalsu commented 3 years ago

The app does not get past the splash screen on Android 11. There are no relevant log messages either.

andreynovikov commented 3 years ago

Have you moved app data to external storage? Recently I've updated my phone and faced the same issue. I hope it will be fixed in next version. But currently you have to move data back (manually) or just reinstall the application (ONLY if you have not created any personal data - tracks or places).

duggalsu commented 3 years ago

I have not moved app data to external storage. I reinstalled the app and it opened on first run. However it did not open again after downloading maps.

I saw two potential issues -

  1. The app does not ask for storage permission on launch
  2. Manually giving storage permission only asks for media access permission
andreynovikov commented 3 years ago

It does not need permission for normal use. Does it crash? If yes, can you look for file on your device: Android/data/mobi.maptrek/cache/export/exception.txt. If it is there paste its contents here or send it to me via email.

duggalsu commented 3 years ago

The app does not crash and the exception file does not exist. I simply get a black screen on launching the app

andreynovikov commented 3 years ago

So, as I understand, app launches correctly until you load the first map. What map is it? Does this happen if you load any map? Try any small one. When you load the map for the first time do you keep application open? Does it finish loading and can you see loaded map? If no, what exactly happens?

duggalsu commented 3 years ago

The maps loads on first app launch and I can use the app. Its only on subsequent app launches that the app fails to work

andreynovikov commented 3 years ago

Please find Android/data/mobi.maptrek/files/native/world.mtiles and attach it here or send me by email. I will try to look what's wrong with it.

SokoFromNZ commented 3 years ago

Hi Andrey,

I seem to have exactly the issue you've described above: I've moved my data to "user storage to prevent data loss" and now Trekarta is stuck on the splash screen.

I did that because Android 11 doesn't allow FolderSync to access Trekarta's app-storage anymore and I like to sync my data.

So I'm kinda stuck here!

Any idea when this issue gets fixed?

thanks Soko

SokoFromNZ commented 3 years ago

After a long night try and error I have more info. Apparently it does not have to do anything with "move data" at all. Its more like duggalsu said:

I reinstalled the app and it opened on first run. However it did not open again after downloading maps.

I've also thought its my SD card I've installed the app on. But after removing it and using the internal storage of my Nokia 2.3 (TA-1206 with Android One 11, Security Update 5.4.2021, Build 00WW_3_220_SP01) the problem persists.

So here are the details:

  1. "Force Stop" of Trekarta and "Clean Storage" (so basically reinstall)
  2. Trekarta opens as usual
  3. Setup a view things including downloading World Map and one area map.
  4. Phone restart
  5. Backup Android/data/mobi.maptrek/* files.
  6. Open Trakarta: Hangs on splash screen (most of the time at least... sometimes it starts but after closing it locking phone for a view minutes and open the app again it hangs definitely)
  7. Force Stop
  8. Delete evrything in Android/data/mobi.maptrek/* but Android/data/mobi.maptrek/files/data.
  9. Open app and no maps are there anymore (of course)
  10. Close app and swipe it close in resent/open apps overview
  11. Delete evrything in Android/data/mobi.maptrek/files/native and copy hillshade.mbtiles and world.mtiles (not the shm/wal files) from the backup
  12. Open app again and it starts and has the maps loaded

More interesting stuff:

As I'm a developer myself and also did Android apps (a while ago) I might be able to help or even debug it myself. Do you use Android Studio as IDE? Which version? Any particular settings of the IDE so I can debug the source here?

I think the world.mtiles is not corrupt as it works from the backup. My educated guess would be that the SQLite version you are using has some issues on Android 11. I reckon you store almost everything in SQLite as even the Cache folder hast shm/wal files in it.

Soko

CuriousCocainist commented 3 years ago

Dear Andrey, I just found your app and instantly fell in love :) Unfortunately have android 11 and above issues affect me as well :( After fresh install the app starts with no problem, allows downloading maps ( I tried only 2-3 tiles), shows position, saves tracks. On the next start it freezes on splash-screen, although from there its behaviour is erratic and it sometimes starts and sometimes don't. Cleaning cache and/or data doesn't seem help consequently. Also there is no "exception.txt" file

SokoFromNZ commented 3 years ago

@CuriousCocainist: I've got it working in my own fork and the PR I've posted. Waiting for Andrey to react.

JonTabor commented 3 years ago

Any updates on this? I'm having the same issue.

SokoFromNZ commented 3 years ago

Nope sorry. No reaction from Andrey on this. If you know how to operate Github with Android Studio you can make a Get on my fork and compile a working version by yourself.

andreynovikov commented 2 years ago

Does the problem persist after latest update?

nettybun commented 2 years ago

I was experiencing this issue last week on Android 12 with 2021.04 release, which was latest at the time. I saw 2022.04 was published yesterday and is now working :)

Also it'd be very helpful if you could publish APKs to the GitHub releases since it avoids the slow update time of F-Droid/Play Store!

SokoFromNZ commented 2 years ago

Looks good on my side. So I closed my Pull Request for this.

andreynovikov commented 2 years ago

@heyheyhello I'm considering that. Problem is that Google changes Android API so often that I have no time to work on new features, but have to fix and change everything they break.

duggalsu commented 7 months ago

Confirmed that current version is working on Android 13. Closing issue