tailscale / tailscale/tailscale
android: `make androidsdk` fails on macOS
- Dominant language
- Go
- Stars
- 36.5k
- Forks
- 3.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 123
Description
New mac.
I installed Android Studio.
I tried to run `make androidsdk` as referenced at https://github.com/tailscale/tailscale-android/ at it fails:
```
bradfitz@bradm4-4 tailscale-android % make androidsdk
Using ANDROID_HOME: /Users/bradfitz/Library/Android/sdk
Using NDK_ROOT:
Using STRIP_TOOL: /toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objcopy
mkdir -p /Users/bradfitz/Library/Android/sdk/tmp
mkdir -p /Users/bradfitz/Library/Android/sdk/cmdline-tools
(cd /Users/bradfitz/Library/Android/sdk/tmp && \
curl --silent -O -L "https://dl.google.com/android/repository/commandlinetools-mac-9477386_latest.zip" && \
echo "2072ffce4f54cdc0e6d2074d2f381e7e579b7d63e915c220b96a7db95b2900ee commandlinetools-mac-9477386_latest.zip" | sha256sum -c && \
unzip commandlinetools-mac-9477386_latest.zip)
usage: sha256sum [-bctwz] [files ...]
make: *** [/Users/bradfitz/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager] Error 1
```
Related, building `libtailscale` at this stage also fails with a not super helpful error:
```
% make libtailscale
Using ANDROID_HOME: /Users/bradfitz/Library/Android/sdk
Using NDK_ROOT:
Using STRIP_TOOL: /toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objcopy
Running gomobile bind to generate unstripped AAR...
Output file: /Users/bradfitz/src/github.com/tailscale/tailscale-android/android/libs/libtailscale_unstripped.aar
mkdir -p /Users/bradfitz/src/github.com/tailscale/tailscale-android/android/libs/
rm -f /Users/bradfitz/src/github.com/tailscale/tailscale-android/android/libs/libtailscale_unstripped.aar
# The -linkmode=external -extldflags=-Wl,-z,max-page-size=16384 is specific to NDK 23
# to support 16kb page sizes. Your mileage may vary with other NDK versions.
/Users/bradfitz/src/github.com/tailscale/tailscale-android/android/build/go/bin/gomobile bind -target android -androidapi 26 \
-tags "$(./build-tags.sh)" \
-ldflags "-linkmode=external -extldflags=-Wl,-z,max-page-size=16384 $(./version-ldflags.sh)" \
-o /Users/bradfitz/src/github.com/tailscale/tailscale-android/android/libs/libtailscale_unstripped.aar ./libtailscale || { echo "gomobile bind failed"; exit 1; }
/Users/bradfitz/src/github.com/tailscale/tailscale-android/android/build/go/bin/gomobile: no usable NDK in /Users/bradfitz/Library/Android/sdk: open /Users/bradfitz/Library/Android/sdk/ndk: no such file or directory, open /Users/bradfitz/Library/Android/sdk/ndk-bundle/meta/platforms.json: no such file or directory
gomobile bind failed
make: *** [build-unstripped-aar] Error 1
```
(but "no usable NDK" is in there, hinting at the clue.... but really it'd be nice if the Makefile had a dep for that target that installed the NDK)
/cc @irbekrm @raggi @barnstar @oxtoacart
Contributor guide
Assessment
This issue has not been assessed yet.