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: confusing "unsupported basic type" error when targeting Android #24762
Comments
I assume this is because gomobile is trying to generate Java code, and Java has no unsigned integer types. However, a quick google search doesn't give a definite answer, and the error message seems like this may be a bug or fixed at some point, rather than a design limitation. Leaving it to @eliasnaur or someone else to decide if the error message should be improved. For example, something like "cannot use unsigned integer types on Java" for the uint16/32/64 errors. |
This doc page does leave unsigned integers out: https://godoc.org/golang.org/x/mobile/cmd/gobind#hdr-Type_restrictions But it's still hard to reach it if one is googling for the error or searching for "uint", since neither appears on the page. |
Change https://golang.org/cl/105377 mentions this issue: |
Before this change, binding unsupported basic types such as uint failed with an error. Instead, add them to the list of ignored types so that no error is generated and a comment is generated explaining why the offending function, constant or variable was skipped. Unsigned integers are probably easy to support in ObjC, but leave them unsupported for now. While here, improve the printing of the ignored types in the explaining comments. Fixes golang/go#24762 Change-Id: I0d9ab471b2245728270f6ee588f554d4a105d500 Reviewed-on: https://go-review.googlesource.com/105377 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Before this change, binding unsupported basic types such as uint failed with an error. Instead, add them to the list of ignored types so that no error is generated and a comment is generated explaining why the offending function, constant or variable was skipped. Unsigned integers are probably easy to support in ObjC, but leave them unsupported for now. While here, improve the printing of the ignored types in the explaining comments. Fixes golang/go#24762 Change-Id: I0d9ab471b2245728270f6ee588f554d4a105d500 Reviewed-on: https://go-review.googlesource.com/105377 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?->go version go1.9 linux/amd64
Does this issue reproduce with the latest release?
->yes
What operating system and processor architecture are you using (
go env
)?->linux, amd64
What did you do?
->programmer
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
Please help me.Why unsupported basic type uint32 or uint64
What did you see instead?
the issues:
use gomobile bind -target=android/arm xxxx,and compile error
unsupported basic type: uint32
unsupported basic type: uint64
The text was updated successfully, but these errors were encountered: