Hard links do not work on Android since 6.0. So modify the file locking mechanism from: if ln "$tmpfile" "$lockf"; then rm -f "$tmpfile"; .. to if mv --update=none-fail "$tmpfile" "$lockf"; then .. Fixes #21736