-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/mobile: Gomobile is not compatible with modern Android SDKs and NDKs #52470
Comments
Proposed fix at https://go-review.googlesource.com/c/mobile/+/401574 |
Thanks for the report. |
Change https://go.dev/cl/401574 mentions this issue: |
Thanks for the report and change. What is the alternative to |
Thank you, I had opened a PR to solve this a different way, but can close this now. |
@bemasc I am unable to find the solution this is just a simple pull request along with some change logs |
I was trying to setup gomobile on my machine using this document wiki https://github.com/golang/go/wiki/Mobile and what I am kind of shocked on is that there is no information about NDK prerequisites to setting up an environment. So you just try to run
And get issues in regard to NDK not being installed. You install the latest via many different methods like Android Studio or brew on mac and they are too new for gomobile so it errors and says "ANDROID_NDK_HOME specifies /usr/local/share/android-ndk, which is unusable: unsupported API version 16 (not in 19..33)"
Currently I am playing with r19c I downloaded from the unsupported versions and it is kind of compiling the hello world example, but osx is saying the developer is not supported when its trying to run clang and Id and other commands and I keep "allowing anyway" in security, but it keeps staying in a loop not allowing it and the build failing. Can anyone help with this issue too? |
@davidrenne If you don't need API 16 support, you can add |
I've come across this too recently because of this change in GitHub actions for the ubuntu image actions/runner-images#5930
What is happening I think is that I added |
I added |
Any updates on this? This issue has now been there for one year, there is a proposed fix and it still is not resolved. |
Anything new? |
I believe this is issue is fixed; gomobile now uses the modern environment variables and selects a compatible NDK and SDK based on your specified targets. If you are still encountering a problem please provide more details about your setup and invocation. |
It's better to add description for |
[like] WeiYaPeng(Jim) reacted to your message:
…________________________________
From: Wang Zhi ***@***.***>
Sent: Tuesday, August 29, 2023 4:58:33 AM
To: golang/go ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [golang/go] x/mobile: Gomobile is not compatible with modern Android SDKs and NDKs (Issue #52470)
It's better to add description for -androidapi to gomobile help bind so people using API level greater than 16 won't encounter incompatible problems.
—
Reply to this email directly, view it on GitHub<#52470 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAKTSGIJR4KH6Q4CUABGDFDXXVZHTANCNFSM5T76SGTQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
still got problem building with stable release of sdk and ndk and after predicting which folder the dev was puting what ndk (i'm not a golang fan just want a aar file from it) still getting more errors like this: |
Hello, I am still getting this error even though I have latest SDKs and NDKs installed from Android Studio. Any idea what I am doing wrong? command: error: |
in new version of android studio the sdk and ndk path are changed you should set your ANDROID_NDK_HOME env variable to "C:\Users\Emad\AppData\Local\Android\Sdk\ndk{latest version}" |
I executed "gomobile build -target=android -androidapi 24" which seems fixed the problem, but this time I have trouble during build as below gomobile: go build -buildmode=c-shared -o C:\Users\eferay\AppData\Local\Temp\gomobile-work-1490098852\lib\armeabi-v7a\libbasic.so golang.org/x/mobile/example/basic failed: exit status 1 runtime/cgocgo: C compiler "C:\Program" not found: exec: "C:\Program": file does not exist I have installed "TDM-GCC-64" and did many environment variable settings, but still I am missing something, any help would be appreciated. |
@eferay93 that's a windows platform issue - clearly you've put in a path somewhere that needs to be "quoted". Windows command line often needs paths with spaces included to be within double quotes, this is not an issue related to |
Still having a problem with deprecated api version APK InstallerThe APK failed to install.
|
This change removes Gomobile's dependency on ANDROID_HOME and ANDROID_NDK_HOME. Setting ANDROID_HOME is generally optional, and ANDROID_NDK_HOME is deprecated. This change also increases the minimum API version to 16, as all SDKs that supported API 15 are now deprecated. Fixes golang/go#52470
Gomobile makes a number of assumptions about the Android SDK and NDK that are no longer correct:
$ANDROID_HOME/ndk-bundle
is the default NDK location (it is now$ANDROID_HOME/ndk/<version>
)These assumptions seem to make Gomobile incompatible with NDK 24, and somewhat inconvenient to use with other modern SDK and NDK versions.
The text was updated successfully, but these errors were encountered: