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: no exported names in the package #48743

Closed
tangxuesong6 opened this issue Oct 2, 2021 · 4 comments
Closed

x/mobile: no exported names in the package #48743

tangxuesong6 opened this issue Oct 2, 2021 · 4 comments
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@tangxuesong6
Copy link

What version of Go are you using (go version)?

go version go1.16.8 linux/amd64

Does this issue reproduce with the latest release?

yes, i ues both 1.16.8 and latest

What operating system and processor architecture are you using (go env)?

GO111MODULE="off"
GOARCH="amd64"
GOBIN="/home/txs/go/bin"
GOCACHE="/home/txs/.cache/go-build"
GOENV="/home/txs/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/txs/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/txs/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/txs/Center/env/go1.16.8.linux-amd64/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/txs/Center/env/go1.16.8.linux-amd64/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.8"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build225390963=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I want to build .aar for Android. LastDay i successed on my windows pc. So, Today i use my Ubuntu 21.04 to try again. got failed.

What did you expect to see?

output an aar file

What did you see instead?

When i exec gomobile bind -target=android hello on my shell, return gomobile: /home/txs/go/bin/gobind -lang=go,java -outdir=/tmp/gomobile-work-895177626 hello failed: exit status 1
no exported names in the package "hello"
no exported names in the package "hello"

@mknyszek mknyszek changed the title gomobile error no exported names in the package x/mobile: no exported names in the package Oct 4, 2021
@mknyszek mknyszek added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Oct 4, 2021
@mknyszek mknyszek added this to the Unreleased milestone Oct 4, 2021
@mknyszek
Copy link
Contributor

mknyszek commented Oct 4, 2021

What does your code look like? Could you share more about what you were trying to do? Please share the precise steps you took to end up in this situation.

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Oct 4, 2021
@tangxuesong6
Copy link
Author

What does your code look like? Could you share more about what you were trying to do? Please share the precise steps you took to end up in this situation.

I use the official code in dir "golang.org/x/mobile/example/bind/hello". The code as follow

// Package hello is a trivial package for gomobile bind example.
package hello

import "fmt"

func Greetings(name string) string {
	return fmt.Sprintf("Hello, %s!", name)
}

After i enter command gomobile bind -target=android hello, the problem arises.

@tangxuesong6
Copy link
Author

Solved. This command gomobile bind -target=android hello should be changed to gomobile bind -target=android ./hello on linux system. Attention ./hello. But i‘m not sure if this is a bug. So I haven't closed this issue for the time being.

@tangxuesong6
Copy link
Author

Solved, close

@golang golang locked and limited conversation to collaborators Oct 13, 2022
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 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants