From 5bca9f640e1c1507c1e5394e812271ba33371f41 Mon Sep 17 00:00:00 2001 From: MatejMagat305 <61238240+MatejMagat305@users.noreply.github.com> Date: Thu, 18 May 2023 16:43:24 +0200 Subject: [PATCH 1/2] add path to ndk on termux it available to build app on android app - termux --- gogio/androidbuild.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gogio/androidbuild.go b/gogio/androidbuild.go index 940b1a5..893aee7 100644 --- a/gogio/androidbuild.go +++ b/gogio/androidbuild.go @@ -837,9 +837,11 @@ func archNDK() string { // Workaround for arm64 macOS. This will keep working until // Apple deprecates Rosetta 2. arch = "x86_64" - } else { - panic("unsupported GOARCH: " + runtime.GOARCH) + } + if runtime.GOOS == "android" { // termux + return "linux-aarch64" } + fallthrough default: panic("unsupported GOARCH: " + runtime.GOARCH) } From 03eebf0b9e0299c31ebeb92e31dba4f2331417a7 Mon Sep 17 00:00:00 2001 From: MatejMagat305 <61238240+MatejMagat305@users.noreply.github.com> Date: Sat, 27 May 2023 15:56:33 +0200 Subject: [PATCH 2/2] if to switch --- gogio/androidbuild.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gogio/androidbuild.go b/gogio/androidbuild.go index 893aee7..c1e39d8 100644 --- a/gogio/androidbuild.go +++ b/gogio/androidbuild.go @@ -833,12 +833,12 @@ func archNDK() string { case "amd64": arch = "x86_64" case "arm64": - if runtime.GOOS == "darwin" { + switch runtime.GOOS { + case "darwin": // Workaround for arm64 macOS. This will keep working until // Apple deprecates Rosetta 2. - arch = "x86_64" - } - if runtime.GOOS == "android" { // termux + return "darwin-x86_64" + case "android": // termux return "linux-aarch64" } fallthrough