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/bind/testdata/testpkg: Readasset() fails in ios #33362

Open
CanRui-Wu opened this issue Jul 30, 2019 · 2 comments

Comments

@CanRui-Wu
Copy link

commented Jul 30, 2019

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

$ go version
go version go1.12.7 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/wucanrui/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/wucanrui/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.7/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.7/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0_/j6m36l9s0psg9xm5ggt2_b680000gp/T/go-build235355928=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

gomobile bind -target=ios golang.org/x/mobile/bind/testdata/testpkg
And then use the testpkgReadasset by using testpkg.Framework.

What did you expect to see?

Everything is ok.

What did you see instead?

Cannot find assets/hello.txt

@gopherbot gopherbot added this to the Unreleased milestone Jul 30, 2019

@gopherbot gopherbot added the mobile label Jul 30, 2019

@katiehockman katiehockman changed the title x/mobile Readasset() in testpkg cannot work in ios x/mobile: Readasset() in testpkg cannot work in ios Jul 31, 2019

@katiehockman katiehockman changed the title x/mobile: Readasset() in testpkg cannot work in ios x/mobile/bind/testdata/testpkg: Readasset() fails in ios Jul 31, 2019

@katiehockman

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2019

@CanRui-Wu Thanks for filing an issue! Can you provide some more details about the error that you got, and provide a full example that can easily reproduce this for investigation?

@CanRui-Wu

This comment has been minimized.

Copy link
Author

commented Aug 1, 2019

@CanRui-Wu Thanks for filing an issue! Can you provide some more details about the error that you got, and provide a full example that can easily reproduce this for investigation?

All I have did are just run 'gomobile bind -target=ios golang.org/x/mobile/bind/testdata/testpkg' . And then drag the 'Testpkg.Framework' into Xcode.

I use it in an ios simulator and then get an error.
20190801102058

However, I run 'gomobile bind -target=android golang.org/x/mobile/bind/testdata/testpkg' and it work in android.

It seem that 'golang.org/x/mobile/cmd/gomobile/bind_iosapp.go' does not handle the assets subdirectory at all. In contrast, 'golang.org/x/mobile/cmd/gomobile/bind_androidapp.go' does handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.