pikaju / flutter-maps-launcher

Simple Flutter package to open the maps application (or browser) on all platforms.
https://pub.dev/packages/maps_launcher
MIT License
60 stars 43 forks source link

Maps launcher is jamming my ios build #4

Closed ellie-me closed 1 year ago

ellie-me commented 4 years ago

Since I upgraded maps launcher to version 1.2.1+1 (build 1) I could not build my app on ios anymore. I got this when running with --verbose.


               ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
               ld: warning: Could not find or use auto-linked library 'swiftCore'
               ld: warning: Could not find or use auto-linked library 'swiftQuartzCore'
               ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
               ld: warning: Could not find or use auto-linked library 'swiftCompatibility50'
               ld: warning: Could not find or use auto-linked library 'swiftDarwin'
               ld: warning: Could not find or use auto-linked library 'swiftUIKit'
               ld: warning: Could not find or use auto-linked library 'swiftFoundation'
               ld: warning: Could not find or use auto-linked library 'swiftCoreImage'
               ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements'
               ld: warning: Could not find or use auto-linked library 'swiftMetal'
               ld: warning: Could not find or use auto-linked library 'swiftDispatch'
               ld: warning: Could not find or use auto-linked library 'swiftCoreMedia'
               ld: warning: Could not find or use auto-linked library 'swiftCoreAudio'
               Undefined symbols for architecture arm64:
                 "__swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements", referenced from:
                     __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_maps_launcher in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                    (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_maps_launcher)
                 "(extension in Foundation):Swift.String._bridgeToObjectiveC() -> __C.NSString", referenced from:
                     static maps_launcher.SwiftMapsLauncherPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     @objc static maps_launcher.SwiftMapsLauncherPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "Swift._bridgeAnythingToObjectiveC(A) -> Swift.AnyObject", referenced from:
                     function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "value witness table for Builtin.UnknownObject", referenced from:
                     full type metadata for maps_launcher.SwiftMapsLauncherPlugin in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "Swift.String.append(Swift.String) -> ()", referenced from:
                     maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "__swift_FORCE_LOAD_$_swiftCompatibility50", referenced from:
                     __swift_FORCE_LOAD_$_swiftCompatibility50_$_maps_launcher in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                    (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility50_$_maps_launcher)
                 "_swift_bridgeObjectRelease", referenced from:
                     maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "type metadata for Swift.String", referenced from:
                     maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "_swift_unknownObjectRelease", referenced from:
                     static maps_launcher.SwiftMapsLauncherPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     @objc static maps_launcher.SwiftMapsLauncherPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "_swift_release", referenced from:
                     ___swift_destroy_boxed_opaque_existential_0 in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "static (extension in Foundation):Swift.String._unconditionallyBridgeFromObjectiveC(__C.NSString?) -> Swift.String", referenced from:
                     maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "_swift_unknownObjectRetain", referenced from:
                     @objc static maps_launcher.SwiftMapsLauncherPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                 "_swift_getInitializedObjCClass", referenced from:
                     static maps_launcher.SwiftMapsLauncherPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     type metadata accessor for maps_launcher.SwiftMapsLauncherPlugin in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     @objc static maps_launcher.SwiftMapsLauncherPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
                     function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of maps_launcher.SwiftMapsLauncherPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libmaps_launcher.a(SwiftMapsLauncherPlugin.o)
               ld: symbol(s) not found for architecture arm64
               clang: error: linker command failed with exit code 1 (use -v to see invocation) ```
dcchristopher commented 3 years ago

@elisamuelps Have you tried flutter clean? I wonder if there are some artifacts from a previous build ...

ellie-me commented 3 years ago

Yes I used flutter clean previously, cleared cache, ran a fresh pods install and I still had the same problem, I tried with different environments and with different macs on Codegamic, I usually build flutter on Codemagic with --verbose so I can better understand build errors, I have also not tested the latest version of maps launcher though, not sure if the error is still happening but I had to remove the plugin from my app.

yanissoalili commented 3 years ago

i had the same problem, but in debug mode I find a interesting thing may help, is that when I add the maps-launcher to the pubsec.yaml after the build and I hot reload the terminal it's working like a charm but if I quit the current build and I try another time I will have the same issue. thanks

yanissoalili commented 3 years ago

i figure out that the problem it's happening only when we use obj-c. the solution is to add a swift file to your flutter project in the Xcode and change the name module and switch it to yes.

dcchristopher commented 3 years ago

i figure out that the problem it's happening only when we use obj-c. the solution is to add a swift file to your flutter project in the Xcode and change the name module and switch it to yes.

That's some great sleuthing there, @yanissoalili!

@elisamuelps Can you try the above and report back if it worked? Here's hoping!

sailes-shakya commented 3 years ago

add a swift file to your flutter project in the Xcode and change the name module and switch it to yes.

Can you guide us,, i enable the swift on my existing project ,still there is problem

yanissoalili commented 3 years ago

You could try in xcode add a new .swift file and xcode will ask to create bridging header, click yes. That should help if the issue is obj-c.

ellie-me commented 3 years ago

i figure out that the problem it's happening only when we use obj-c. the solution is to add a swift file to your flutter project in the Xcode and change the name module and switch it to yes.

That's some great sleuthing there, @yanissoalili!

@elisamuelps Can you try the above and report back if it worked? Here's hoping!

sure! I'm a bit busy at the moment with work so bare with me, I will update this thread and close the issue once I try the fix that @yanissoalili found which I'm like 99% sure it will work as when I created my project on Android Studio I remember clearly on not enabling ios swift support, nor my xcode project has support for swift.

I can do a pull request to the readme.md with instructions afterwards so future devs are aware to enable swift before using this library.

pikaju commented 1 year ago

I hope this issue no longer persists. I'll close it, considering how old it is.