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: handle assets on iOS #33350

Closed
CanRui-Wu opened this issue Jul 29, 2019 · 1 comment
Closed

x/mobile: handle assets on iOS #33350

CanRui-Wu opened this issue Jul 29, 2019 · 1 comment
Labels
Milestone

Comments

@CanRui-Wu
Copy link

@CanRui-Wu CanRui-Wu commented Jul 29, 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-build792194215=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I am new to IOS.

I build an IOS framework file by using gomobile.

I run gomobile bind -target=ios xxx (xxx is a package with a subdirectory "assets", and there are a file 'config.json' in assets).

In xxx package, I use asset.Open() to get the asset but it failed with log (no such file or directory). And then when I check the 'bind_iosapp.go' in gomobile, I find that it does not handle the "assets" directory at all.

What did you expect to see?

I can use my asset file in xxx.framework by using golang.

What did you see instead?

I see this tip on godoc of gomobile.(On iOS an asset is a resource stored in the application bundle. Resources can be loaded using the same relative paths). How can I get the asset file? Should I use the asset.Open API? What the path I should put the asset file into IOS is?

@gopherbot gopherbot added this to the Unreleased milestone Jul 29, 2019
@gopherbot gopherbot added the mobile label Jul 29, 2019
@julieqiu julieqiu changed the title x/mobile ios assets x/mobile: ios assets Jul 29, 2019
@julieqiu julieqiu changed the title x/mobile: ios assets x/mobile: iOS assets Jul 29, 2019
@julieqiu julieqiu changed the title x/mobile: iOS assets x/mobile: how to handle iOS assets Jul 29, 2019
@julieqiu julieqiu changed the title x/mobile: how to handle iOS assets x/mobile: handle assets on iOS Jul 29, 2019
@julieqiu

This comment has been minimized.

Copy link

@julieqiu julieqiu commented Jul 29, 2019

For asking questions about learning the language, see one of our forums: https://golang.org/wiki/Questions We only use this issue tracker for tracking bugs. People in the forums can explain what is happening here.

@julieqiu julieqiu added the Question label Jul 29, 2019
@julieqiu julieqiu closed this Jul 29, 2019
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.