-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: build failing when using go modules #37372
Comments
@axet I am guessing some cgo related setup is not correct. it's strange that |
I did clean everyging and now only first issue is present. It failed to build on first run, second run succeed. And I have no issues to build a library old GOPATH style (no cgo issues). Steps:
ok |
Thanks for the update. Would be nice if u can provide the output in module mode i asked in my previous comment. It will be helpful for us to prepare for complete migration to modules mode near future. |
Sure. Second issue was related to NDK r16. I know it is not supported, but I able to build using NDK r16 using GOPATH, but failed with go mod's with error above. NDK r19 works fine booth ways. Answering your question, here is output of |
@axet thanks! @matloob @bcmills @jayconrod It is hard to debug due to caching by go command. I observed inconsistency of Attached are the logs I captured by running gomobile bind twice back to back.
The first run failed with some cgo errors ( Observed that some modules were downloaded and $GOPATH/pkg directory and GOCACHE became non-empty as a result of go command run. The second run shows the same cgo error, but Is this unstable behavior a known bug of my environment:
|
It's weird that the cgo errors happen on one run but disappear later. They ought to either always be reported or never reported. I don't know enough about how Also, where does the |
@jayconrod
|
FWIW, I used to get the same error as @hyangah but after upgrading Android Studio and reinstalling the NDK with |
Using go1.18.2, and android-ndk-r23c in Ubuntu 20.04, with gcc-10 and openjdk-8, I get the same error. I need to run this command twice to build my project:
with the first run failing due to |
(CC @golang/android @golang/ios) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
gomobile failed with 'nrecognized command line option '-marm'' and second run on same code gives different output ' cannot determine module path for source directory' this issue related to previous one #37048
second run (same command: gomobile bind)
commands:
The text was updated successfully, but these errors were encountered: