/ go Public
x/mobile: asset.Open does not work in iOS when called within a generated framework #37177
Android, iOS, and x/mobile
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
What did you do?
gomobile bindproduced framework which attempted to use
golang.org/x/mobile/asset's Open function
I used the platform specific output in Android and iOS projects.
What did you expect to see?
I expected that on Android I would be able to read the file at run time if it was placed in the
src/main/assetsdirectory of the Android project where our GoMobile library was being included
I expected that on iOS I would be able to read the file at run time if it was set up as a Bundle Resource in XCode for the project where our GoMobile framework was being included
What did you see instead?
On Android it was able to discover a JSON file in the
src/main/assetsdirectory with a known name without issue.
On iOS I added the file in XCode and verified it was available in the
[[NSBundle mainBundle] resourcePath]directory in Objective-C at runtime. Gomobile could not discover this, and was looking in a relatively pathed /assets directory instead of the directory where Bundle Resources where placed in the app.
The source code of the iOS implementation of the function does not seem to actually use any native APIs to discover the root of where it should look for bundle resources https://github.com/golang/mobile/blob/master/asset/asset_darwin_armx.go
The text was updated successfully, but these errors were encountered: