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: .aar file does not show function parameters #64816

Closed
Thiagohalves85 opened this issue Dec 20, 2023 · 3 comments
Closed

x/mobile: .aar file does not show function parameters #64816

Thiagohalves85 opened this issue Dec 20, 2023 · 3 comments
Labels
mobile Android, iOS, and x/mobile WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@Thiagohalves85
Copy link

Thiagohalves85 commented Dec 20, 2023

Hello.
When I create the .aar file with bind when using the function, its parameters come as var0, var1... instead of the correct name.
Is there any way when generating the .aar file that the function has the correct names?
Thanks.

1- gomobile bind -androidapi 24 -target=android -ldflags="-s -w" -o app/spdnfe_componente.aar ./framework/spdnfe

2- Created spdnfe_componente.aar

3- Import lib in Android Studio

4- call any function the arguments are like var0, var1

Go Version 1.21.4

Go env

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\thiago.alves\AppData\Local\go-build
set GOENV=C:\Users\thiago.alves\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\thiago.alves\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\thiago.alves\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.21.4
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\thiago.alves\Documents\Estudo\Go\shared-library\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\THIAGO~1.ALV\AppData\Local\Temp\go-build1670470057=/tmp/go-build -gno-record-gcc-switches

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Dec 20, 2023
@gopherbot gopherbot added this to the Unreleased milestone Dec 20, 2023
@thanm thanm added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 20, 2023
@hyangah
Copy link
Contributor

hyangah commented Dec 21, 2023

If I remember correctly, bind preserves the parameter names in source code generation level. I don't know whether all the info is preserved when building aar out of the generated source code.

(see the test case: https://github.com/golang/mobile/blob/76ac6878050a2eef81867f2c6c21108e59919e8f/bind/testdata/basictypes.objc.h.golden#L30, translating https://github.com/golang/mobile/blob/76ac6878050a2eef81867f2c6c21108e59919e8f/bind/testdata/basictypes.go#L17)

The -x -v flags will print what gomobile bind is doing underneath. I hope that helps you inspect where the info is dropped. x/mobile/cmd/gobind will also help investigate whether the source code generation is working as you expected.

@Thiagohalves85
Copy link
Author

Thanks for the help @hyangah, but I still haven't been able to find out why the name of the properties doesn't appear in the method, I'll continue searching.

@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jan 28, 2024
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants