Skip to content

Commit 47bd386

Browse files
committed
WIP 2
1 parent 31ba600 commit 47bd386

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/build-manual.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ jobs:
5656
flutter-version: '3.38.x'
5757
channel: 'stable'
5858
- run: flutter --version
59-
- name: Install ndk-bundle
59+
- name: Install ndk
6060
run: |
6161
echo "ls $ANDROID_HOME/"
6262
ls -lah $ANDROID_HOME/ || true
6363
echo "ls $ANDROID_HOME/tools/bin/"
6464
ls -lah $ANDROID_HOME/tools/bin/ || true
6565
echo "ls $ANDROID_HOME/cmdline-tools/latest/bin/"
6666
ls -lah $ANDROID_HOME/cmdline-tools/latest/bin/ || true
67-
echo "install ndk-bundle"
68-
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk-bundle"
67+
echo "install ndk"
68+
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;27.0.12077973"
6969
- name: List available space
7070
run: |
7171
df -h
@@ -90,7 +90,6 @@ jobs:
9090
unset ANDROID_NDK_HOME
9191
cd awl
9292
go install golang.org/x/mobile/cmd/gomobile@latest
93-
go get golang.org/x/mobile/cmd/gomobile
9493
gomobile init
9594
go mod tidy -compat=1.26
9695
cd cmd/awl-tray && go mod tidy -compat=1.26 && cd ../..

build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ build-web() {
135135
# build android library
136136
build-android-lib() {
137137
cd "$awldir/cmd/gomobile-lib"
138+
#export CGO_LDFLAGS="-O2 -g -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384 -Wl,--hash-style=both"
138139
# about `-checklinkname=0` https://github.com/wlynxg/anet#how-to-build-with-go-1230-or-later
139-
gomobile bind -trimpath -ldflags "-s -w -checklinkname=0 -X github.com/anywherelan/awl/config.Version=${VERSION}" -o anywherelan.aar -target=android .
140+
gomobile bind -androidapi 24 -trimpath \
141+
-ldflags "-linkmode=external -extldflags=-Wl,-z,max-page-size=16384 -s -w -checklinkname=0 -X github.com/anywherelan/awl/config.Version=${VERSION}" \
142+
-o anywherelan.aar -target=android . || { echo "gomobile bind failed"; exit 1; }
140143
mkdir -p "$awlflutterdir/android/app/src/main/libs"
141144
mv anywherelan.aar "$awlflutterdir/android/app/src/main/libs/"
142145
}

0 commit comments

Comments
 (0)