-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: does not work with Go 1.22 if a vendor folder is present, even with the GO111MODULE=off
workaround
#67927
Comments
Similar Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Another thing I tried is #43736 (comment): Import But then
|
GO111MODULE=off
workaroundGO111MODULE=off
workaround
Can you try to manually list the golang.org/x/mobild/bind/* packages in an ignored file, and run
Keeping up with all the Go, Android, Apple toolchains changes is a non-trivial task. Unfortunately, there is nobody actively working on x/mobile as of today. |
Thanks for the suggestion. I tried this. Here is the go.mod file:
These are all the files:
(mobilex.go is the file with the dummy imports you suggested). Running (using Go 1.22.4)
results in
This is unfortunate indeed. We heavily rely on gomobile and it has been a huge success for us so far. See also this post of appreciation. Paging a person who recently committed to x/mobile: @hajimehoshi - maybe you also have some suggestions for how to fix this? I'd be happy to contribute, but I am afraid I am a bit out of my depth. |
Hi,
I've added a go list args logic that gives the possibility to add flags and resolves the issue (see golang/mobile#105)
|
Allows passing `-mod=mod` to `gomobile` to fix golang/go#67927.
Go version
go1.22.4 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Using a dummy main.go:
What did you see happen?
The above fails with:
As a workaround, before Go1.22, one could install mobile/bind to
$GOPATH
and usegomobile bind
without modules to side-step this issue completely:Since GO 1.22 however,
go get
is not allowed anymore outside of modules.What did you expect to see?
No error running
gomobile bind
.gomobile bind
seems to be unworkable using Go 1.22 when a vendor folder is present. The only workaround seems to be to delete thevendor
folder before usinggomobile bind
.Related: #34181, but the
GO111MODULE=off
workaround does not work anymore as of Go 1.22.The text was updated successfully, but these errors were encountered: