v1.19.0 chrashes on Android

I just updated from 1.18.0 to 1.19 on my Android 6.0.1 phone. Syncthing asks me for location permission and to reset the database. When I click Reset Database, Syncthing crashes. So I can’t use Syncthing any more.

I tried to downgrade to the previous version (I have the 1.18.0 APK) but installation fails. (“App not installed” message)

How do I fix this?

PS: Crash report submitted on device.

1 Like

For the record, you can downgrade applications by uninstalling them using adb uninstall -k <package-name> first, and then reinstalling, which retains the app data. However, please keep in mind that there’s no guarantee that the newer data will be compatible with the older app version, so I’d suggest to be very cautious and make a backup before experimenting with anything like this.

Otherwise, you can simply try uninstalling and reinstalling the app from the GUI, but then you’ll end up starting from scratch. This won’t touch the actual synced files, which will remain on the device nevertheless.

Thanks for the adb uninstall -k info. As my USB port is blocked by a installed wireless charging pad, it is not easily done.

Hope to get a real fix or workaround for the crash.

Yeah, I can’t help with that, but as for the blocked port, you can try enabling wireless ADB in the Developer Options (as long as the phone manufacturer hasn’t disabled it, which they sometimes do) and connect do the device with that.

Edit: You could try to post the crash logs here as well though. This way more people will be able to have a look at them and possibly help find out what’s wrong.

1 Like

Have the same issue on Android 7.1.2 / LineageOS 14.1.

I see a matching crash in the console:

  at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1341)
  at org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:324)
  at org.apache.commons.io.FileUtils.deleteQuietly (FileUtils.java:1236)
  at com.nutomic.syncthingandroid.activities.FirstStartActivity.upgradeToApiLevel30 (FirstStartActivity.java:213)
  at com.nutomic.syncthingandroid.activities.FirstStartActivity.access$500 (FirstStartActivity.java:51)
  at com.nutomic.syncthingandroid.activities.FirstStartActivity$ViewPagerAdapter$3.onClick (FirstStartActivity.java:333)
  at android.view.View.performClick (View.java:6312)
  at android.widget.TextView.performClick (TextView.java:11202)
  at android.view.View$PerformClick.run (View.java:23985)
  at android.os.Handler.handleCallback (Handler.java:751)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6816)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1563)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1451)

Which seems like that library is using some method that doesn’t exist on such old androids?!
I guess I need to manually implement recursive directory deletion then - not that it’s hard, but it’s ridiculous.

1 Like

I’m not an Android developer and have no idea where I could find a crash log. (accessible without root?) I bet 99% of Android have not even heard of adb. The ‘normal’ Syncthing logfile in the accessible data directory is from before the update.

Not that old; it’s my current phone (hardly used). I mainly use Syncthing on my previous phone (HUAWEI Y330 with Android 4.2.2) that I use as dedicated MP3 player. (Runs more than a week with >10h playing on a single charge. great) However it was not possible to install from the Play store. I guess there are other compatibility criteria checked. Possible screen resolution. The missing exit entry in the clipped main menu is the only issue found so far.

I’m running version 1.19.0 on Android 12 on a Galaxy S10e and have had no issue at all

1 Like

Fix is in review - if others agree I’ll do a hotfix release for this.

The fix is released on Github, pending approval on Google Play: https://github.com/syncthing/syncthing-android/releases/tag/
Thanks @Audrius for the quick review and @Catfriend1 for the suggestion of the easiest possible fix :slight_smile:

1 Like

Unfortunately does not seam to fix the crash on my device. Exact same behavior as 1.19.0.

(I suppose installing from the store, multiple crashes and “Force Stop” in the App Settings should be enough for the new code to be used.) Android\data\com.nutomic.syncthingandroid\files\Syncthing.log is still the log file from 1.18; I don’t know where I could find the crash log.

I guess so, but I don’t have any crash report in the console matching this issue and Android is borked enough that I’d suggest restarting the phone to make sure. If it doesn’t help, I’ll need logs/crash reports (I’ll have a look into the console later to day if any came in late).

Restarting the phone does not change anything. I could make a screen shot of the stack trace in the preview of the crash report:

Would it be possible for you to run 1.18.x in an emulator with the oldest supported android version; sync something and than update to 19.0 in order to reproduce the crash?

1 Like

Thanks for the screenshot, the problem is clear: Java - NoSuchMethodError not caught by Exception - Stack Overflow

Just released the fix of the fix, should soon become available.

1 Like

Guess what… still crashes.

Would it be possible for you to run 1.18.x in an emulator with the oldest supported android version; sync something and than update to 19.0 in order to reproduce the crash and test 1.19 is working?

That was progress :stuck_out_tongue:
Yeah I’ll see if that works, but I am pretty confident an emulator won’t be able to repro this kind of error. If it doesn’t, ould you be able to install an apk if I provide one from our CI, so we can test again before I release again?

Send me the link to the apk. Hope it is not rejected as in the case of the downgrade.

Could you test this, no downgrading or anything needed: https://build.syncthing.net/repository/download/SyncthingAndroid_Build/116823:id/apk/debug/app-debug.apk?guest=true

Installs and runs successfully but as a new separate app. So there is no need to reset the database and the code in question is likely not executed at all.