Syncthing keeps crashing silently in the background

I have a problem on one of my Android devices, where Syncthing keeps crashing in the background with no visible error messages, i.e. there are neither any notifications on the Android device itself nor any errors in the Web GUI (when connected remotely).

To be specific, the Web GUI simply stops responding at all, while the application does open, but all folders are marked as “Unknown”. I need to restart Syncthing completely to get it back to life, but the next crash occurs just a few hours later and stops everything again anyway.

I am using the official Syncthing application v1.4.2 under Android 4.4.4. I have two other devices with similar configuration, i.e. the same version of Syncthing, the same folders shared, etc., but those two do not experience any of these problems.

The logfile seems quite short, and I am guessing that it has been overwritten by Syncthing trying to restart and failing in the process.

[XFY6L] INFO: quic://0.0.0.0:22000 detected NAT type: Symmetric NAT
[XFY6L] INFO: quic://0.0.0.0:22000 resolved external address quic://125.190.151.7:2278 (via stun.syncthing.net:3478)
[XFY6L] INFO: Established secure connection to EEYCH4R-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 10.0.0.6:33794-10.0.0.5:22000/tcp-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[XFY6L] INFO: Device EEYCH4R-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX client is "syncthing v1.4.2" named "XXXXXXXXXXX" at 10.0.0.6:33794-10.0.0.5:22000/tcp-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[XFY6L] INFO: Detected 2 NAT services
[XFY6L] INFO: Established secure connection to MN2XAEL-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 10.0.0.6:58854-10.0.0.4:22000/tcp-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[XFY6L] INFO: Device MN2XAEL-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX client is "syncthing v1.4.2" named "XXXXXXXXXXX" at 10.0.0.6:58854-10.0.0.4:22000/tcp-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[start] INFO: syncthing v1.4.2 "Fermium Flea" (go1.14.1 android-arm) vagrant@basebox-stretch64 2020-04-07 11:14:03 UTC
[start] WARNING: Error opening database: resource temporarily unavailable (is another instance of Syncthing running?)
[start] INFO: syncthing v1.4.2 "Fermium Flea" (go1.14.1 android-arm) vagrant@basebox-stretch64 2020-04-07 11:14:03 UTC
[start] INFO: No automatic upgrades; STNOUPGRADE environment variable defined.
[XFY6L] INFO: My ID: XFY6LHE-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX
[XFY6L] INFO: Hashing performance is 13.66 MB/s
[XFY6L] INFO: Overall send rate is unlimited, receive rate is unlimited
[XFY6L] INFO: Using discovery server https://discovery.syncthing.net/v2/?noannounce&id=LYXKCHX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX
[XFY6L] INFO: Using discovery server https://discovery-v4.syncthing.net/v2/?nolookup&id=LYXKCHX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX
[XFY6L] INFO: Using discovery server https://discovery-v6.syncthing.net/v2/?nolookup&id=LYXKCHX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX
[XFY6L] INFO: QUIC listener ([::]:22000) starting
[XFY6L] INFO: Ready to synchronize "XXXXXXXXXXX (XXX)" (xxxxx-xxxxx) (sendonly)
[XFY6L] INFO: TCP listener ([::]:22000) starting
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] INFO: Ready to synchronize "XXXXXXXXXXX (XXX)" (xxxxx-xxxxx) (sendonly)
[XFY6L] INFO: Ready to synchronize "XXX" (xxxxx-xxxxx) (sendreceive)
[XFY6L] INFO: Ready to synchronize "XXX" (xxxxx-xxxxx) (sendreceive)
[XFY6L] INFO: GUI and API listening on [::]:8384
[XFY6L] INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
[XFY6L] INFO: My name is "XXXXXXXXXXX"
[XFY6L] INFO: Device EEYCH4R-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX is "XXXXXXXXXXX" at [tcp://10.0.0.5 dynamic]
[XFY6L] INFO: Device MN2XAEL-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX is "XXXXXXXXXXX" at [tcp://10.0.0.4 dynamic]
[XFY6L] INFO: Device TLFGVKC-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX is "XXXXXXXXXXX" at [dynamic]
[XFY6L] INFO: Device 6HPLASD-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX is "XXXXXXXXXXX" at [dynamic]
[XFY6L] INFO: Device 6ULTOO6-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX is "XXXXXXXXXXX" at [dynamic]
[XFY6L] INFO: Device D4DZUGP-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX is "XXXXXXXXXXX" at [tcp://10.0.0.2 dynamic]
[XFY6L] INFO: Established secure connection to D4DZUGP-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 10.0.0.6:58541-10.0.0.2:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
[XFY6L] INFO: Device D4DZUGP-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX client is "syncthing v1.4.2" named "XXXXXXXXXXX" at 10.0.0.6:58541-10.0.0.2:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
[XFY6L] INFO: quic://0.0.0.0:22000 detected NAT type: Symmetric NAT
[XFY6L] INFO: quic://0.0.0.0:22000 resolved external address quic://125.190.151.7:2281 (via stun.syncthing.net:3478)
[XFY6L] INFO: Established secure connection to EEYCH4R-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 10.0.0.6:50577-10.0.0.5:22000/tcp-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[XFY6L] INFO: Device EEYCH4R-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX client is "syncthing v1.4.2" named "XXXXXXXXXXX" at 10.0.0.6:50577-10.0.0.5:22000/tcp-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[XFY6L] INFO: Listen (BEP/relay): Get "https://relays.syncthing.net/endpoint": stream error: stream ID 1; INTERNAL_ERROR
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.000000 failures of 2.000000), restarting: true, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] INFO: Detected 2 NAT services
[XFY6L] INFO: Established secure connection to MN2XAEL-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 10.0.0.6:58775-10.0.0.4:22000/tcp-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[XFY6L] INFO: Device MN2XAEL-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX client is "syncthing v1.4.2" named "XXXXXXXXXXX" at 10.0.0.6:58775-10.0.0.4:22000/tcp-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[XFY6L] INFO: Listen (BEP/relay): Get "https://relays.syncthing.net/endpoint": stream error: stream ID 3; INTERNAL_ERROR
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.786692 failures of 2.000000), restarting: true, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] INFO: Listen (BEP/relay): Get "https://relays.syncthing.net/endpoint": stream error: stream ID 5; INTERNAL_ERROR
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] INFO: Entering the backoff state.
[XFY6L] INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (2.404646 failures of 2.000000), restarting: false, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] INFO: Completed initial scan of sendreceive folder "XXXXXXXXXXX" (xxxxx-xxxxx)
[XFY6L] INFO: Completed initial scan of sendreceive folder "XXXXXXXXXXX" (xxxxx-xxxxx)
[XFY6L] INFO: Completed initial scan of sendonly folder "XXXXXXXXXXX (XXX)" (xxxxx-xxxxx)
[XFY6L] INFO: Completed initial scan of sendonly folder "XXXXXXXXXXX (XXX)" (xxxxx-xxxxx)
[XFY6L] INFO: Established secure connection to TLFGVKC-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 10.0.0.6:57268-144.76.71.91:22067/relay-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[XFY6L] INFO: Device TLFGVKC-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX client is "syncthing v1.4.2" named "XXXXXXXXXXX" at 10.0.0.6:57268-144.76.71.91:22067/relay-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256
[XFY6L] INFO: Exiting backoff state.
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] INFO: Listen (BEP/relay): Get "https://relays.syncthing.net/endpoint": stream error: stream ID 1; INTERNAL_ERROR
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.000000 failures of 2.000000), restarting: true, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] INFO: Listen (BEP/relay): Get "https://relays.syncthing.net/endpoint": stream error: stream ID 3; INTERNAL_ERROR
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.787457 failures of 2.000000), restarting: true, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] INFO: Listen (BEP/relay): Get "https://relays.syncthing.net/endpoint": stream error: stream ID 5; INTERNAL_ERROR
[XFY6L] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] INFO: Entering the backoff state.
[XFY6L] INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (2.407509 failures of 2.000000), restarting: false, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] INFO: Connection to MN2XAEL-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 10.0.0.6:58775-10.0.0.4:22000/tcp-client/TLS1.3-TLS_CHACHA20_POLY1305_SHA256 closed: Syncthing is being stopped
[XFY6L] INFO: quic://0.0.0.0:22000 resolved external address quic://125.190.151.7:2283 (via stun.syncthing.net:3478)
[XFY6L] INFO: quic://0.0.0.0:22000 resolved external address quic://125.190.151.7:22000 (via stun.syncthing.net:3478)

I have also grabbed and backed up the whole database folder just in case it is needed.

What do you think of this, and is there anything else I should do to help debug this problem?

Hi,

It seems there is a zombie native instance still holding resources locked. Please try to restart the phone first.

[start] WARNING: Error opening database: resource temporarily unavailable (is another instance of Syncthing running?)

Yeah, restarting the phone makes Syncthing start again, but then the same crash occurs a few hours later, and the circle repeats itself :slightly_frowning_face:.

Syncthing crashed again at night after a few hours of working properly, and the zombie process seems to be stuck using the CPU, as the device has been running hot all the time.

I am going to try running the ARM binary of Syncthing directly from terminal and see if there is anything meaningful there.

1 Like

I have been testing the Linux ARM binary for around 24 hours, and everything seems to be working smoothly with 0 crashes so far. Setting Syncthing up was not the easiest thing in the world, mainly due to Android’s limitations, but I think that I will keep using it this way, at least on this device.

I still need to figure out how to run it as a normal user instead of root, as right now I have just copied the binary straight to the /sdcard partition, and Android does not allow execute permissions there.

Also, just in case someone is interested, I have automated everything with Automagic to simulate at least some functionality of the Android wrapper. Easer is the open source alternative, but I have found it way too complex and convoluted to use.

Anyway, what I am doing is basically

killall -CONT syncthing || /sdcard/Syncthing/syncthing -home=/sdcard/Syncthing/files -no-browser -logfile=/sdcard/Syncthing/files/syncthing.log

when the device is being charged and connected to WiFi, and

killall -STOP syncthing

when running on battery or on mobile connection.

I hope that pausing and resuming Syncthing like this will not cause any issues, as completely stopping, restarting, and scanning all the 50,000+ files again and again takes extremely long time on the old and slow hardware, so I would like to avoid it as much as possible :sweat:.

2 Likes

I am writing again, bacause it seems that Syncthing crashed again sometime during the night. The problem is that the logfile is just cut off without any specific errors or panics.

[XFY6L] 17:36:24 INFO: Exiting backoff state.
[XFY6L] 17:36:24 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] 17:36:24 INFO: Listen (BEP/relay): Get https://relays.syncthing.net/endpoint: dial tcp: lookup relays.syncthing.net on [::1]:53: read udp [::1]:36436->[::1]:53: read: connection refused
[XFY6L] 17:36:24 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] 17:36:24 INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.000000 failures of 2.000000), restarting: true, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] 17:36:24 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] 17:36:24 INFO: Listen (BEP/relay): Get https://relays.syncthing.net/endpoint: dial tcp: lookup relays.syncthing.net on [::1]:53: read udp [::1]:48746->[::1]:53: read: connection refused
[XFY6L] 17:36:24 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] 17:36:24 INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.999476 failures of 2.000000), restarting: true, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] 17:36:24 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] 17:36:24 INFO: Listen (BEP/relay): Get https://relays.syncthing.net/endpoint: dial tcp: lookup relays.syncthing.net on [::1]:53: read udp [::1]:41970->[::1]:53: read: connection refused
[XFY6L] 17:36:24 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] 17:36:24 INFO: Entering the backoff state.
[XFY6L] 17:36:24 INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (2.998465 failures of 2.000000), restarting: false, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] 17:48:44 INFO: Exiting backoff state.
[XFY6L] 17:48:44 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[XFY6L] 17:48:44 INFO: Listen (BEP/relay): Get https://relays.syncthing.net/endpoint: dial tcp: lookup relays.syncthing.net on [::1]:53: read udp [::1]:50337->[::1]:53: read: connection refused
[XFY6L] 17:48:44 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[XFY6L] 17:48:44 INFO: c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.000000 failures of 2.000000), restarting: true, error: "{dynamic+https://relays.syncthing.net/endpoint dynamic+https://relays.syncthing.net/endpoint} returned unexpectedly", stacktrace: [unknown stack trace]
[XFY6L] 17:48:44 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting

After the relay related messages, the logging just suddenly stops.

Are there any specific debug options, which I should enable in order to possibly obtain more information on the crash causes?

On a side note, I have also managed to run the binary without root, but I will elaborate on this a little bit later.

1 Like

Again, syncthing pretty much never exits by itself, so you are most likely looking at the wrong logs if you want to understand who killed it.

2 Likes

Well, I did check logcat several times, but did not find anything related to Syncthing there :slightly_frowning_face:. It has been running fine for 12+ hours today, so I will keep an eye on it and see whether there are any specific circumstances that cause the process to exit.

Now, when it comes to running the Syncthing binary for Linux ARM on Android without root, this is what I have done:

adb push syncthing /data/local/tmp/
adb shell chmod 0777 /data/local/tmp/syncthing ; HOME=/sdcard ; /data/local/tmp/syncthing

While /sdcard does not allow executable permissions, the /data/local/tmp folder does, and is available to non-root users too, so it is possible to copy and run syncthing from there.

Also, HOME needs to be explicitly defined, because otherwise the process panics with the following error message:

$HOME is not defined
panic: Failed to get default config dir

goroutine 1 [running]:
github.com/syncthing/syncthing/lib/locations.defaultConfigDir(0x240bc80, 0x240ea00)
        /syncthing/lib/locations/locations.go:140 +0x128
github.com/syncthing/syncthing/lib/locations.init()
        /syncthing/lib/locations/locations.go:73 +0x20

With HOME set to /sdcard, Syncthing will store its configuration following the defaults explained in Syncthing Configuration — Syncthing v1 documentation, which in this case is /sdcard/.config/syncthing. Of course, it is possible to adjust the paths with switches.

2 Likes

I just wanted to add a few updates after running Syncthing on Android without the application for about a week.

a) When using a binary compiled with GOOS=linux, there is a problem with imprecise modification times on FAT partitions. Syncthing deals with it automatically when compiled specifically for Android as follows.

The problem is that this logic is not applied when running the Linux binary directly. Thus, it seems to be necessary to manually set ModTimeWindowS to 2 in the Advanced configuration.

Is this correct? During my testing, I have personally experienced a few cases where “Receive Only” files were marked as “Local Additions”, which I suspect could have been caused by the FAT modification times, but I have no hard proof for it.

Following the Golang documentation at https://golang.org/pkg/go/build/,

- the target operating system, as spelled by runtime.GOOS,

so I believe that my way of thinking is right, but please correct me if necessary.

b) I run Syncthing only when connected to power, but if one intends to run the binary when on battery too, then in the newer Android versions it may be necessary to disable Doze with

dumpsys deviceidle disable

and if needed re-enable it later with

dumpsys deviceidle enable

or otherwise the operating system will likely kill the syncthing process. Doze is applied only when using the battery, and not when the device is connected to a power source.

c) Syncthing itself seems to be running very stable without any unexpected crashes, but I still need more time to test and check everything more thoroughly. The logfiles, at least, do not show anything special in comparison to my other Syncthing installations.

There are probably a lot more things that differ between goos=android and goos=linux. We have a couple small ones in Syncthing, but also given that Go itself treats these as distinct operating systems there are bound to be differences in how it does syscalls, uses DNS, etc, what have you.

3 Likes

Yes, I have been trying to compile with GOOS=android, but with no success. Compiling for Linux or Windows is super easy, but when it comes to Android, it seems to be a little bit of a nightmare, at least for someone less experienced like myself. I have so far compiled various Linux kernels or other small applications, but this one seems kind of rough, with the whole setup requiring the Android NDK, GCC, and various other Android-specific preparations.

Granted, I have been trying to cross-compile it only under Windows so far. I am going to give another try later, perhaps on Debian, and see whether there is any difference there.

I fully agree. For what it’s worth there is a Docker image syncthing/syncthing-android-builder that has the required setup, in which you can probably just run the build script with -goos=android.

2 Likes

You could try building the binary only (without the APK) with this https://github.com/Catfriend1/syncthing-android/blob/master/SyncthingNative_update_and_build.cmd .

Prerequisites are mentioned by the script, so you can install one by one if anything is missing. If you have git, sed and python, it should do downloading and making portable installations of the rest things that are needed by itself during the first build. It’s my documentation how to build in case my build machine dies and this needs to be taken over to another computer.

1 Like

Wow, thank you @calmh and @Catfriend1 so much :grin:. I was in the midst of setting up the Docker image when I saw the Catfriend’s post. I then downloaded the Syncthing-Fork repository, analysed the script, and then figured out how to compile just the binary for Android.

It proved to be way easier than I had expected.

set CGO_ENABLED=1
set CC=%~dp0\android-ndk-r21\toolchains\llvm\prebuilt\windows-x86_64\bin\armv7a-linux-androideabi16-clang.cmd
go run build.go -goos android -goarch arm build

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.