Skip to content
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

Closed
Anyhasgone opened this issue Apr 8, 2018 · 3 comments
Closed
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@Anyhasgone
Copy link

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

@gopherbot gopherbot added this to the Unreleased milestone Apr 8, 2018
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 8, 2018
@mvdan
Copy link
Member

mvdan commented Apr 8, 2018

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.

@mvdan mvdan added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 8, 2018
@mvdan mvdan changed the title x/mobile: x/mobile: confusing "unsupported basic type" error when targeting Android Apr 8, 2018
@mvdan
Copy link
Member

mvdan commented Apr 8, 2018

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.

@gopherbot
Copy link

Change https://golang.org/cl/105377 mentions this issue: bind: ignore unsupported basic types

@golang golang locked and limited conversation to collaborators Apr 10, 2019
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
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>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

3 participants