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

Ensure the bundling of C symbols on iOS archive #16

Open
brickpop opened this issue Dec 24, 2020 · 1 comment
Open

Ensure the bundling of C symbols on iOS archive #16

brickpop opened this issue Dec 24, 2020 · 1 comment
Assignees

Comments

@brickpop
Copy link
Owner

brickpop commented Dec 24, 2020

Option 1

Follow https://flutter.dev/docs/development/platform-integration/c-interop#ios-symbols-stripped

Option 2

See from https://github.com/drewcrawford/Rust-iOS-Example#the-case-of-the-missing-symbols


What seems to happen is Xcode strips some symbols from a framework when it's built. So if you have libhello.a inside a framework, and the framework doesn't call anything inside libhello.a, all of libhello.a is striped. If you only call one function, the others are stripped etc.

So what you have to do is declare an exported_symbols.txt like

_hello
_benchmark

And then set that file as the framework's Exported Symbols File in the framework's build settings.

@brickpop brickpop self-assigned this Dec 24, 2020
@brickpop
Copy link
Owner Author

brickpop commented Dec 27, 2020

Append to the podfile (main app)

post_install do |installer|
  project = installer.pods_project

  project.targets.each do |target|
    if target.name == 'PublicA'
      # Link dependencies into PublicA.framework
      target.build_configurations.each do |config|
        #config.build_settings['DEAD_CODE_STRIPPING'] = 'NO'
        config.build_settings['STRIP_STYLE'] = "non-global"
      end
    end
  end

end

Or append on the library podspec:

spec.pod_target_xcconfig = { 'STRIP_STYLE' => 'non-global' }  # ...  'OTHER_LDFLAGS' => '-lObjC' 

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