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

ios: Undefined symbol: async function pointer to share_handler_ios_models.ShareHandlerIosViewController #17

Closed
jimmyff opened this issue Jul 12, 2022 · 10 comments

Comments

@jimmyff
Copy link

jimmyff commented Jul 12, 2022

Hi, i'm migrating from receive_sharing_intent

When I try to build my app I get the following build errors:

Undefined symbol: async function pointer to share_handler_ios_models.ShareHandlerIosViewController.(handleText in _E48DB9355F792D6AF47E6D0E54D5F698)(content: __C.NSExtensionItem, attachment: __C.NSItemProvider, index: Swift.Int) async throws -> ()
Undefined symbol: async function pointer to share_handler_ios_models.ShareHandlerIosViewController.(handleFiles in _E48DB9355F792D6AF47E6D0E54D5F698)(content: __C.NSExtensionItem, attachment: __C.NSItemProvider, index: Swift.Int) async throws -> ()
Undefined symbol: async function pointer to share_handler_ios_models.ShareHandlerIosViewController.(handleUrl in _E48DB9355F792D6AF47E6D0E54D5F698)(content: __C.NSExtensionItem, attachment: __C.NSItemProvider, index: Swift.Int) async throws -> ()
Undefined symbol: async function pointer to share_handler_ios_models.ShareHandlerIosViewController.(handleImages in _E48DB9355F792D6AF47E6D0E54D5F698)(content: __C.NSExtensionItem, attachment: __C.NSItemProvider, index: Swift.Int) async throws -> ()
Undefined symbol: async function pointer to share_handler_ios_models.ShareHandlerIosViewController.(handleVideos in _E48DB9355F792D6AF47E6D0E54D5F698)(content: __C.NSExtensionItem, attachment: __C.NSItemProvider, index: Swift.Int) async throws -> ()
Undefined symbol: async function pointer to share_handler_ios_models.ShareHandlerIosViewController.(handleData in _E48DB9355F792D6AF47E6D0E54D5F698)(content: __C.NSExtensionItem, attachment: __C.NSItemProvider, index: Swift.Int) async throws -> ()

Any guidance would be really appreciated.

Thanks!

@shawoozy
Copy link

Same issue here

@benPesso
Copy link

Did you try flutter clean and deleting the ~/Library/Developer/Xcode/DerivedData/ folder? It's likely that you just have old Pod data.

@shawoozy
Copy link

okey I got it to work, thx @benPesso
So this library requires IOS 14, but I refactored the swift code to run on older IOS versions and that also seems to work!

@JoshJuncker
Copy link
Collaborator

@sharokh1 What code did you refactor to work on older versions? Also, was it just a flutter clean and deleting derived data that got rid of the 'Undefined symbol...' errors? I have a friend who is getting those errors on his project, but not on the example project, and those steps didn't seem to help him. In the end, he reverted back to copy and pasting all of the view controller code directly into his share view controller rather than inheriting from the view controller in the module.

@shawoozy
Copy link

shawoozy commented Jul 19, 2022

@JoshJuncker so there are three things

  • check if the buildsettings of the extension and the runner target are the same
  • set the iOS version to 14 in both targets
  • an edit in the share_handler_ios.podspec
    replace this
    s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
    with
    s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }

I'm curious if this will solve the problem of your friend.

edit: the code refactor I mentioned earlier made it so the files were not properly read in flutter 😢

@benPesso
Copy link

  • set the iOS version to 14 in both targets

I'm not sure if this is relevant, as mine are set to target v12.

@shawoozy
Copy link

shawoozy commented Jul 19, 2022

then how does it work for you ? the whole swift controller has
@available(iOS 14.0, *)

try to run it on a device which is running iOS 13 or below

@benPesso
Copy link

Sorry, meant to say 13...
platform :ios, '13.0'

@shawoozy
Copy link

That would not matter, as the share extension controller only works on iOS 14+ that is why I'm asking you to try to run your app on a device/simulator with iOS 13 or below. My expectation is that the share functionality will not work.

@benPesso
Copy link

I was going by what you said and referred to the fact that the constraint was not necessary for the build to succeed. I wouldn't know to speculate what devices it would run on or not (and I don't have an iOS device with a version old enough to test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants