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

Android app crash when sync with file system #8759

Closed
ludob opened this issue Sep 2, 2023 · 7 comments
Closed

Android app crash when sync with file system #8759

ludob opened this issue Sep 2, 2023 · 7 comments
Labels
bug It's a bug stale An issue that hasn't been active for a while...

Comments

@ludob
Copy link

ludob commented Sep 2, 2023

Environment

Joplin version: 2.11.32
Platform: Android 13
OS specifics:

Steps to reproduce

  1. Install Joplin Android app from Play store
  2. Transfer data on the Android device via syncthing (data created with Windows Joplin app)
  3. Go to Configuration menu in Joplin Andoid app and set up the Synchronizzation target as File system and add the corresponding folder in the directory to synchronize with. Complete configuration can be seen in the screenshots below:
    Screenshot_20230902-110826
    Screenshot_20230902-110855

Describe what you expected to happen

After that it is supposed to sync all local Joplin data with the app. Unfortunately it stops and crashed randomly.
Screenshot_20230902-110816

I also already tried to :

  • reboot the phone
  • delete the app and install it again
  • change the settings to ensure the phone does not go to sleep
  • change the number of connections to 2
  • change the synchronization interval
    but the app behavior still did not change.
    Sometimes it starts to sync but then crashes and sometimes it crashes before any sync.

Please find below the sync status:
Screenshot_20230902-111812

Also you can find in the screenshot below that the notes are sync but not the hierarchy of the notes with folder does not appear in the menu on the left as he does in the Windows Joplin app.
screenshot-2023-08-31-11-08-30-default

Logfile

Complete bug report can be found attached below:
bugreport-panther-TQ3A.230805.001-2023-08-31-11-08-30.zip

@ludob ludob added the bug It's a bug label Sep 2, 2023
@ludob
Copy link
Author

ludob commented Sep 2, 2023

Additional bug report attached:
syncReport-1693473154164.txt

@tomasz1986
Copy link

tomasz1986 commented Sep 2, 2023

Your file system path is wrong. You need to use an absolute path, e.g. /sdcard/Sync/Joplin or similar and not a link starting with content://. If your file explorer doesn't show full paths, then you can use something like Material Files which does do it, so that you can copy the path from there and paste it into the Joplin app.

@ludob
Copy link
Author

ludob commented Sep 3, 2023

I used TotalCommander to get the full path storage/emulated/o/Sync/Joplin but I can not copy it in the Joplin app. When clicking on the field it automatically opens the explorer to find a folder.

Other scenarios:
1/ Is there a file I can edit to change the field?
2/ Is there a way to import in Android app via a Joplin jex file import?

@tomasz1986
Copy link

tomasz1986 commented Sep 3, 2023

Yeah, so this is something introduced recently... You used to be able to simply input the path manually. However, I've just tested this myself, and the app now only opens a file explorer app which you then need to use to select the folder instead. However, the resulting path is not absolute, but as in your case, it uses a content:// type structure.

Yet, in my case, the sync does seem to still work when using a content:// path. It is extremely slow though when compared to how it worked before 😕. By "slow" I mean that what used to take a few seconds now takes several minutes, and there aren't even any changes to sync. The sync icon just keeps spinning for a very long time. To be exact, the sync took around 30s before, and it now takes almost 5 minutes.


So I've figured out what is going on with the content:// thing. In sum, I've been only upgrading Joplin and not reinstalling, hence my absolute path kept working. However, in the current versions of Joplin, you are forced to use a file picker to select the folder, and this way generates links starting with content://. On top of that, the newest versions don't work with absolute links anymore, i.e. the content:// type generated links are required.

In details, this is what I did in my testing.

  1. I installed https://github.com/laurent22/joplin-android/releases/tag/android-v2.8.1. This is the last version that allows to input the filesystem path manually (e.g. /sdcard/Syncthing/Joplin)
  2. I ran the commands from Android filesystem sync is broken after 2.6.3 update #5779 (comment).
    adb shell cmd appops set net.cozic.joplin android:no_isolated_storage allow
    adb shell cmd appops set net.cozic.joplin android:legacy_storage allow
    adb shell am force-stop net.cozic.joplin
    
    This allows the app to actually access the path and perform synchronisation.
  3. I upgraded the app to https://github.com/laurent22/joplin-android/releases/tag/android-v2.11.32. At this point, synchronisation still works despite using the absolute path.
  4. I upgraded again to https://github.com/laurent22/joplin-android/releases/tag/android-v2.12.1. This finally breaks the old absolute path synchronisation.
    image
  5. In order to fix the problem, I had to add the path again, but this time using a file picker which generated a content:// link instead.
  6. Synchronisation now works again but it is very slow compared to the old method.

To be honest, I will probably stay at v2.11.32, as my phone is already very slow, and on top of that waiting 5 minutes just to be able to use the app every time is a no-go.


Now, coming back to the issue here, my original comment about the content:// link being wrong is incorrect. Sync should still work when using it, and the app shouldn't crash when doing so. You will probably have to wait for someone knowledgeable enough about Android to analyse the logs.

@ludob
Copy link
Author

ludob commented Sep 7, 2023

Deleting the latest version of Joplin and installing first the v2.8.1 and then directly the v2.11.32 did the trick. I did not need to launch any adb commands.
It took a while (1 hour+) to get all ~2000 items synced (including attachments).

Thank you tomasz1986 ! :)

Copy link
Contributor

github-actions bot commented Nov 1, 2023

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

@github-actions github-actions bot added the stale An issue that hasn't been active for a while... label Nov 1, 2023
@ludob
Copy link
Author

ludob commented Nov 2, 2023

This solved the issue.

@ludob ludob closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug stale An issue that hasn't been active for a while...
Projects
None yet
Development

No branches or pull requests

2 participants