Open xDragonZ opened 1 year ago
(attn @golang/ios)
import the library to xcode
Import how? (Is there something you need to configure in xcode to set the linker flags for the final executable?)
Import xcframework to xcode project target. No, nothing to configure in xcode
@xDragonZ, try adding libresolv.9.tbd
and/or libresolv.tbd
in the Linked Frameworks and Libraries
section.
(See https://mozilla.github.io/firefox-browser-architecture/experiments/2017-09-06-rust-on-ios.html.)
Thank you 🫡 finally got it working.
Passing extldflags=-lresolv
to gomobile doesn't works but adding libresolv.tbd
able to compile the ios app without error now.
Great! Want to send a CL to update the documentation? (Probably goes in one of the files in https://cs.opensource.google/go/x/mobile/+/master:cmd/gomobile/ ..?)
Could you please share how you got this working? Running into the same issue and somehow adding libresolv.tbd and libresolv.9.tbd (for me it shows under Apple SDK and not IOS SDK; not sure if that matters) does nothing.
@gurupras you need to add it to "Frameworks & Libraries" section too
Hi friends,
Not clear if downstream now has to deal with this from now on, or if this will be addressed upstream (making many gophers happy).
Adding to Frameworks & Libraries wasn't working for me. I had to go to Build Phases > Link Libraries and add it there
Hola puedes dejar lo Pasos que hiciste plis??? Tengo el mismo problema y no entiendo bien lo qué hay que hacer por favor necesito saber qué fue lo que hizo
include -tags=netgo
while compiling
e.g
gomobile bind -v -tags=netgo -ldflags='-s -w' -target=ios -o libtest.xcframework
Unfortunately, the suggested fix to use -tags=netgo
appears to cause DNS resolution issues on real iOS devices running iOS 17+. It seems that Apple is preventing DNS resolvers embedded by apps to work properly.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Using MacOS with Go 1.20 error, no issue in 1.19.5
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
After compiling using
gomobile bind -v -ldflags='-s -w' -target=ios -o libtest.xcframework github.com/example/test
in terminal and import thelibtest.xcframework
library to xcode, it will show error in xcode when trying to compile ios appWhat did you expect to see?
What did you see instead?
Related: https://github.com/golang/go/issues/58159