{"action":"created","issue":{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/7687","repository_url":"https://api.github.com/repos/CocoaPods/CocoaPods","labels_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/7687/labels{/name}","comments_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/7687/comments","events_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/7687/events","html_url":"https://github.com/CocoaPods/CocoaPods/issues/7687","id":317687328,"number":7687,"title":"Pod install embeds a pod into a Swift framework binary instead of linking it","user":{"login":"bryanboyko","id":8292189,"avatar_url":"https://avatars1.githubusercontent.com/u/8292189?v=4","gravatar_id":"","url":"https://api.github.com/users/bryanboyko","html_url":"https://github.com/bryanboyko","followers_url":"https://api.github.com/users/bryanboyko/followers","following_url":"https://api.github.com/users/bryanboyko/following{/other_user}","gists_url":"https://api.github.com/users/bryanboyko/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanboyko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanboyko/subscriptions","organizations_url":"https://api.github.com/users/bryanboyko/orgs","repos_url":"https://api.github.com/users/bryanboyko/repos","events_url":"https://api.github.com/users/bryanboyko/events{/privacy}","received_events_url":"https://api.github.com/users/bryanboyko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-25T15:47:08Z","updated_at":"2018-04-27T07:06:37Z","closed_at":null,"author_association":"NONE","body":"# Report\r\n\r\nThird parties are having issues integrating our SDK into their apps because cocoapods embeds pods in our SDK binary. If the third party installs us via cocoapods, there are no collisions. Unfortunately, we are working with third party unity apps, which require a .framework to be included in the Unity IDE, which then generates an XCode project. Since pods are embedded in our .framework binary, if one of the same pods is separately included in the unity project, the unity generated XCode project will have dependency collisions at runtime.\r\n\r\nBelow is a bare bones example of the collision found in the unity generated project (minus all the other code and Unity)\r\n\r\n## What did you do?\r\n\r\n1. Created a dynamic framework called FrameworkNoFAN\r\n2. Build FrameworkNoFAN\r\n3. Note that FrameworkNoFAN binary is 14KB\r\n\r\n4. Created a dynamic framework called FrameworkWithFAN\r\n5. Pod install FBAudienceNetwork into FrameworkWithFAN\r\n6. Build FrameworkWithFAN\r\n7. Note that FrameworkWithFAN binary is 3.6MB\r\n \r\n8. Create an app called AppWithFANAndFrameworkWithFAN\r\n9. Manually embed FrameworkWithFAN from step 6 in AppWithFANAndFrameworkWithFAN\r\n10. Import FrameworkWithFAN and call a method from one of its classes that calls into FBAudienceNetwork code\r\n11. Note that the app builds and runs successfully (Other than binary size, this shows that FBAudienceNetwork was embedded in FrameworkWithFAN)\r\n12. Now separately pod install FBAudienceNetwork into AppWithFANAndFrameworkWithFAN\r\n13. Open AppWithFANAndFrameworkWithFAN.xcworkspace and run the app. It crashes at runtime.\r\n\r\n## What did you expect to happen?\r\n\r\nFor step 7, the binary should not be so large.\r\n\r\nFor step 11, the app should not be able to run, since FBAudienceNetwork was not linked at the app level.\r\n\r\nFor step 13, the app should run successfully.\r\n\r\n## What happened instead?\r\n\r\n- FBAudienceNetwork was embedded in FrameworkWithFAN binary.\r\n\r\n- If an app embeds FrameworkWithFAN and separately integrates FAN, the app crashes due to multiple copies of FAN with the following errors.\r\n\r\n```\r\nobjc[54106]: Class FNFMediaPresentationDescription is implemented in both /Users/bryanboyko/Library/Developer/CoreSimulator/Devices/304E3757-2898-4B8E-87CE-A23B1A709436/data/Containers/Bundle/Application/FDEB7649-2341-43CD-AE04-F1CC80F24B74/AppWithFANAndFrameworkWithFAN.app/Frameworks/FrameworkWithFAN.framework/FrameworkWithFAN (0x10bea1308) and /Users/bryanboyko/Library/Developer/CoreSimulator/Devices/304E3757-2898-4B8E-87CE-A23B1A709436/data/Containers/Bundle/Application/FDEB7649-2341-43CD-AE04-F1CC80F24B74/AppWithFANAndFrameworkWithFAN.app/AppWithFANAndFrameworkWithFAN (0x106a07358). One of the two will be used. Which one is undefined.\r\n\r\nobjc[54106]: Class FNFMpdTimelineEntry is implemented in both /Users/bryanboyko/Library/Developer/CoreSimulator/Devices/304E3757-2898-4B8E-87CE-A23B1A709436/data/Containers/Bundle/Application/FDEB7649-2341-43CD-AE04-F1CC80F24B74/AppWithFANAndFrameworkWithFAN.app/Frameworks/FrameworkWithFAN.framework/FrameworkWithFAN (0x10bea1358) and /Users/bryanboyko/Library/Developer/CoreSimulator/Devices/304E3757-2898-4B8E-87CE-A23B1A709436/data/Containers/Bundle/Application/FDEB7649-2341-43CD-AE04-F1CC80F24B74/AppWithFANAndFrameworkWithFAN.app/AppWithFANAndFrameworkWithFAN (0x106a073a8). One of the two will be used. Which one is undefined.\r\n\r\n2018-04-25 16:59:14.624287+0200 AppWithFANAndFrameworkWithFAN[54106:66185369] *** Terminating app due to uncaught exception 'FBFinalClassViolationException', reason: 'FBAdLogger is a final class and cannot be subclassed. FBAdLogger'\r\n```\r\n\r\n## CocoaPods Environment\r\n\r\n### Stack\r\n\r\n```\r\n   CocoaPods : 1.5.0.beta.1\r\n        Ruby : ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]\r\n    RubyGems : 2.7.6\r\n        Host : Mac OS X 10.12.6 (16G29)\r\n       Xcode : 9.2 (9C40b)\r\n         Git : git version 2.14.3 (Apple Git-98)\r\nRuby lib dir : /usr/local/Cellar/ruby/2.5.0_2/lib\r\nRepositories : master - https://github.com/CocoaPods/Specs.git @ 9b6afabdff3b26a9c74d05520116743091cb536a\r\n               MAX-Specs - git@github.com:MAXAds/Specs.git @ 259d2ca1b57ffb3ed724317196b44019d723aef0\r\n               maxads - https://github.com/MAXAds/Specs.git @ 69d003598551ac26c4d58dce35fe5fe1d9378142\r\n               Specs - git@github.com:MAXAds/Specs.git @ 69d003598551ac26c4d58dce35fe5fe1d9378142\r\n```\r\n\r\n### Installation Source\r\n\r\n```\r\nExecutable Path: /usr/local/bin/pod\r\n```\r\n\r\n### Plugins\r\n\r\n```\r\ncocoapods-deintegrate : 1.0.2\r\ncocoapods-packager    : 1.5.0\r\ncocoapods-plugins     : 1.0.0\r\ncocoapods-search      : 1.0.0\r\ncocoapods-stats       : 1.0.0\r\ncocoapods-trunk       : 1.3.0\r\ncocoapods-try         : 1.1.0\r\n```\r\n\r\n\r\n## Project that demonstrates the issue\r\n\r\nhttps://github.com/bryanboyko/PodEmbeddedInFramework\r\n"},"comment":{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/comments/384884598","html_url":"https://github.com/CocoaPods/CocoaPods/issues/7687#issuecomment-384884598","issue_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/7687","id":384884598,"user":{"login":"bryanboyko","id":8292189,"avatar_url":"https://avatars1.githubusercontent.com/u/8292189?v=4","gravatar_id":"","url":"https://api.github.com/users/bryanboyko","html_url":"https://github.com/bryanboyko","followers_url":"https://api.github.com/users/bryanboyko/followers","following_url":"https://api.github.com/users/bryanboyko/following{/other_user}","gists_url":"https://api.github.com/users/bryanboyko/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanboyko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanboyko/subscriptions","organizations_url":"https://api.github.com/users/bryanboyko/orgs","repos_url":"https://api.github.com/users/bryanboyko/repos","events_url":"https://api.github.com/users/bryanboyko/events{/privacy}","received_events_url":"https://api.github.com/users/bryanboyko/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T07:06:37Z","updated_at":"2018-04-27T07:06:37Z","author_association":"NONE","body":"After leaning more about frameworks, it sounds like Cocoapods is behaving as it should in relation to my above question so it makes sense to close this out?\r\n\r\nI just need to figure out a way to build FrameworkWithFAN so there are no linker errors when it's installed into AppWithFANAndFrameworkWithFAN..\r\n\r\nMaybe make FrameworkWithFAN also as a static lib? There will be no runtime linker errors if FAN is embedded in a static binary?"}}
{"actor":{"display_login":"bryanboyko"}}