gomobile bind in win10

344 views
Skip to first unread message

scott sc

unread,
Mar 8, 2023, 11:42:20 PM3/8/23
to golang-nuts
0

I am a learner of golang ,trying to use golang to develop android When I want to package into APK, I encounter the following problems

I'm following the official guide to install gomobile. OS:Win10 go version go1.20.2 windows/amd64

I have installed Android Studio and SDK Tools(NDK)

I have set patch

ANDROID_HOME // C:\Users\AI007\AppData\Local\Android\Sdk

ANDROID_NDK_HOME // C:\Users\AI007\AppData\Local\Android\Sdk\ndk\25.2.9519653

When I want to package into APK, I encounter the following problems

input command

C:\Users\AI007>gomobile bind -target=android goapp

show

gomobile: ANDROID_NDK_HOME specifies C:\Users\AI007\AppData\Local\Android\Sdk\ndk\25.2.9519653, which is unusable: unsupported API version 16 (not in 19..33)

Google has found a lot of methods, how to solve this problem, it has troubled me for several days, thank you

Brian Candler

unread,
Mar 9, 2023, 3:03:04 AM3/9/23
to golang-nuts
A bit of Googling and I find:


Android NDK r24 (March 2022)
Changelog
...
  • Jelly Bean (APIs 16, 17, and 18) is no longer supported. The minimum OS supported by the NDK is KitKat (API level 19).


Flag -androidapi sets the Android API version to compile against. The default and minimum is 16.

Therefore, without having tested this myself, I suggest you should try using flag -androidapi=19 to use the version of the NDK you have, which is newer than r24.
Reply all
Reply to author
Forward
0 new messages