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

Warning about Alamofire not being safe for Application Extensions #40

Closed
mac-cain13 opened this issue May 31, 2019 · 1 comment
Closed

Comments

@mac-cain13
Copy link
Contributor

mac-cain13 commented May 31, 2019

When using the Promissum/Alamofire subspec you'll get the following warning:

ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/[yada-yada]-iphonesimulator/Alamofire/Alamofire.framework/Alamofire

This is because Alamofire declares NOT to be safe for use in application extensions, while Promissum declares it is:

s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }

@mac-cain13
Copy link
Contributor Author

Tried 3 options:

  1. ❌ Move the pod_target_xcconfig into the subspec declarations and override, but this results in an error when running pod install: [!] Can't merge pod_target_xcconfig for pod targets: ["Alamofire", "Core", "UIKit"]. Singular build setting APPLICATION_EXTENSION_API_ONLY has different values.

  2. ✅ Put the pod_target_xcconfig in it's own subspec, this works as expected, but requires the user to do something.

  3. ✅ While testing this I noticed that if the app/extension target the pod is for requires APPLICATION_EXTENSION_API_ONLY then this will be applied to the Pods also. So I think that we can just remove the pod_target_xcconfig line from the podspec.

mac-cain13 added a commit to mac-cain13/Promissum that referenced this issue May 31, 2019
Avoid declaring `APPLICATION_EXTENSION_API_ONLY` when this is not the case (ie when using with Alamofire). CocoaPods will apply `APPLICATION_EXTENSION_API_ONLY` automatically if the target requires it.
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