Skip to content

Commit

Permalink
Merge pull request #1180 from ooni/fix/android
Browse files Browse the repository at this point in the history
fix(android): pin ndk version and repair build
  • Loading branch information
bassosimone committed Jan 12, 2021
2 parents 4c99860 + 1965daa commit ffa7850
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- mobile-staging
- 'release/**'
jobs:
test:
runs-on: macos-latest
Expand All @@ -12,7 +13,8 @@ jobs:
go-version: "1.14"
- uses: actions/checkout@v2
- run: brew cask install android-sdk
- run: echo y | sdkmanager --install "platforms;android-29" ndk-bundle
- run: echo y | sdkmanager --install "platforms;android-29"
- run: echo y | sdkmanager --install "ndk;21.3.6528147"
- run: ./build-android.bash
env:
ANDROID_HOME: /usr/local/Caskroom/android-sdk/4333796
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- mobile-staging
- 'release/**'
jobs:
test:
runs-on: macos-latest
Expand Down
24 changes: 23 additions & 1 deletion build-android.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ -z "$ANDROID_HOME" -o "$1" = "--help" ]; then
echo ""
echo "Then make sure you install the required packages:"
echo ""
echo "sdkmanager --install 'build-tools;29.0.3' ndk-bundle"
echo "sdkmanager --install 'build-tools;29.0.3' 'ndk;21.3.6528147'"
echo ""
echo "or, if you already installed, that you're up to date:"
echo ""
Expand All @@ -22,6 +22,28 @@ if [ -z "$ANDROID_HOME" -o "$1" = "--help" ]; then
echo ""
exit 1
fi
if [ -d $ANDROID_HOME/ndk-bundle ]; then
echo ""
echo "FATAL: currently we need 'ndk;21.3.6528147' instead of ndk-bundle"
echo ""
echo "See https://github.com/ooni/probe-engine/issues/1179."
echo ""
echo "To fix: sdkmanager --uninstall ndk-bundle"
echo ""
exit 1
fi
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.3.6528147
if [ ! -d $ANDROID_NDK_HOME ]; then
echo ""
echo "FATAL: currently we need 'ndk;21.3.6528147'"
echo ""
echo "See https://github.com/ooni/probe-engine/issues/1179."
echo ""
echo "To fix: sdkmanager --install 'ndk;21.3.6528147'"
echo ""
exit 1
fi

topdir=$(cd $(dirname $0) && pwd -P)
set -x
export PATH=$(go env GOPATH)/bin:$PATH
Expand Down

0 comments on commit ffa7850

Please sign in to comment.