Skip to content

Unable to build 9.0.0 and up due to undefined symbols on ios #713

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

Closed
jpancotti opened this issue Apr 10, 2024 · 6 comments
Closed

Unable to build 9.0.0 and up due to undefined symbols on ios #713

jpancotti opened this issue Apr 10, 2024 · 6 comments

Comments

@jpancotti
Copy link
Contributor

Env:
ios: 17.0
"react": "18.2.0",
"react-native": "0.72.7",
"react-native-document-picker": "9.0.0^",

Undefined symbol: _UTTypeCopyPreferredTagWithClass
Undefined symbol: _UTTypeCreatePreferredIdentifierForTag
Undefined symbol: _kUTTagClassFilenameExtension
Undefined symbol: _kUTTagClassMIMEType

I have tried cleaning the build resetting yarn cache and linking unified type identifiers framework

@vonovak
Copy link
Member

vonovak commented Apr 10, 2024

Hello and thanks for asking,
unfortunately, I don't remember getting such error when I last built the example project.
My advice would be to try the sponsor-only package https://react-native-documents.github.io/docs/install . It's a new rewrite which uses Swift and I think there's a good chance it will work. You can get it for $29 if you sponsor monthly (edit: after you sponsor, you get to keep the last version released during sponsorship forever; monthly sponsorship is not required) and I'll give you the money back if you show me that the same issue is there as well.

Thank you 🙂

@jpancotti
Copy link
Contributor Author

jpancotti commented Apr 14, 2024

When was the last time you built the example project? Because it appears to be based on 8.2.0, and this issue is only with 9.0.0 and up.

- react-native-document-picker (8.2.0):

Nice try with the paywall, very helpful. Just infinite easy payments of $29 a month and theres a 'good chance' the library will work? I reached for my wallet so fast I think I tore my rotator cuff.

Hello and thanks for asking, unfortunately, I don't remember getting such error when I last built the example project. My advice would be to try the sponsor-only package https://react-native-documents.github.io/docs/install . It's a new rewrite which uses Swift and I think there's a good chance it will work. You can get it for $29 if sponsor monthly and I'll give you the money back if you show me that the same issue is there as well.

Thank you 🙂

@vonovak
Copy link
Member

vonovak commented Apr 14, 2024

When was the last time you built the example project? Because it appears to be based on 8.2.0, and this issue is only with 9.0.0 and up.

- react-native-document-picker (8.2.0):

Nice try with the paywall, very helpful. Just infinite easy payments of $29 a month and theres a 'good chance' the library will work? I reached for my wallet so fast I think I tore my rotator cuff.

Hi!
The information stored in the lockfile is read from package.json at the time pod install is executed. So what can happen (and happened) is that you run pod install (v8 goes into the lockfile), then do a bunch of development and release v9. But example's lockfile stays as it was. v9 was definitely built and tested before released (and was downloaded 84k times in the last week).

Nice try with the paywall, very helpful. Just infinite easy payments of $29 a month and theres a 'good chance' the library will work?

You can buy it for $29 and then keep that package version forever. After sponsorship ends, you'll only lose access to updates, but the package is already fairly feature-complete.
I said 'good chance' simply because I cannot make a guarantee. I've been doing OSS without compensation for years (wouldn't always call it 'easy'), and decided I wanted to get compensated for the work I do. I don't think there's anything wrong about that, and if you don't want to give the paid version a try, that's fine 🙂 .
I wasn't very clear about the monthly sponsorship so sorry about that.

@jpancotti
Copy link
Contributor Author

I solved the build errors by adding the following to my podfile

    installer.generated_projects.each do |project|
      project.build_configurations.each do |config|
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= ['$(inherited)'] 
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '$(SDKROOT)/System/Library/Frameworks' 
        config.build_settings['OTHER_LDFLAGS'] ||= ['$(inherited)', '-framework MobileCoreServices'] 
      end
      project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= ['$(inherited)'] 
          config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '$(SDKROOT)/System/Library/Frameworks' 
          config.build_settings['OTHER_LDFLAGS'] ||= ['$(inherited)', '-framework MobileCoreServices'] 
        end
      end
    end

This should solve #685 as well.

@vonovak
Copy link
Member

vonovak commented Apr 16, 2024

Hello,
can you please check if adding s.frameworks = 'MobileCoreServices'

to the podspec helps?

(re-run pod install after the change).

Thank you!

@jpancotti
Copy link
Contributor Author

Yes. This change solves the issue without the changes in my previous comment. I double checked by reverting it and the issue came back.

PR #715 sent.

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

2 participants