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

Build for distribution #1426

Closed
hrabkin opened this issue Sep 15, 2022 · 1 comment
Closed

Build for distribution #1426

hrabkin opened this issue Sep 15, 2022 · 1 comment

Comments

@hrabkin
Copy link

hrabkin commented Sep 15, 2022

Hello,

I would like to use SocketIO as a dynamic dependency of my xcframework

I have checked your project and see that you don't use option BUILD_LIBRARY_FOR_DISTRIBUTION:

189948772-d0117bcd-d267-46ac-aa2f-6f2ad0fdc5fb

why?

This option

Ensures that your libraries are built for distribution. For Swift, this enables support for library evolution and generation of a module interface file

https://xcodebuildsettings.com

Without forcing this option in Pods project there's the following error in runtime:

dyld[20229]: Symbol not found: _$s8SocketIO0A11ClientEventO5erroryA2CmFWC
  Referenced from: .../Frameworks/MyFramework.framework/MyFramework
  Expected in: .../MyApp.app/Frameworks/SocketIO.framework/SocketIO

I can confirm this error running project with the dependencies under Rosetta with some of these options used:

config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = ’x.0'
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'

P.S. Also these issues have relation to the ticket #1356 #1269

Current workaround is to add at the end of project's Podfile where Socket-IO integrated:

# Socket.IO-Client-Swift
post_install do |lib|
    lib.pods_project.targets.each do |target|
      if target.name == 'Socket.IO-Client-Swift'
          target.build_configurations.each do |config|
              config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
          end
      end
    end
end

and remove if used:

config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = ’x.0'
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
@hrabkin
Copy link
Author

hrabkin commented Aug 11, 2023

Closing because of several other posts on the same topic

@hrabkin hrabkin closed this as completed Aug 11, 2023
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

1 participant