{"action":"created","issue":{"url":"https://api.github.com/repos/Carthage/Carthage/issues/688","repository_url":"https://api.github.com/repos/Carthage/Carthage","labels_url":"https://api.github.com/repos/Carthage/Carthage/issues/688/labels{/name}","comments_url":"https://api.github.com/repos/Carthage/Carthage/issues/688/comments","events_url":"https://api.github.com/repos/Carthage/Carthage/issues/688/events","html_url":"https://github.com/Carthage/Carthage/issues/688","id":101414100,"number":688,"title":"How to add framework with inner framework in an app ","user":{"login":"jsslai","id":3702742,"avatar_url":"https://avatars.githubusercontent.com/u/3702742?v=3","gravatar_id":"","url":"https://api.github.com/users/jsslai","html_url":"https://github.com/jsslai","followers_url":"https://api.github.com/users/jsslai/followers","following_url":"https://api.github.com/users/jsslai/following{/other_user}","gists_url":"https://api.github.com/users/jsslai/gists{/gist_id}","starred_url":"https://api.github.com/users/jsslai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsslai/subscriptions","organizations_url":"https://api.github.com/users/jsslai/orgs","repos_url":"https://api.github.com/users/jsslai/repos","events_url":"https://api.github.com/users/jsslai/events{/privacy}","received_events_url":"https://api.github.com/users/jsslai/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Carthage/Carthage/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-17T12:54:12Z","updated_at":"2016-05-16T12:09:54Z","closed_at":"2015-08-18T05:10:13Z","body":"I have a following project setup:\r\n\r\n- TestApp\r\n  - TestAppKit.framework\r\n    - ReactiveCocoa.framework\r\n    - Result.framework\r\n\r\nIs it necessary to add ReactiveCocoa and Result frameworks in TestApp's \"Embedded Binaries\"? Is it possible for TestAppKit.framework to include both ReactiveCocoa and Result frameworks in TestAppKit.framework bundle? Then I don't have to include all the dependencies in the application target. I found something related in this stackoverflow answer:\r\nhttp://stackoverflow.com/questions/31250342/how-to-use-realm-installed-with-carthage-with-a-framework-in-a-swift-app\r\n\r\nSo if I add carthage copy-frameworks in TestAppKit.framework build phases I don't have to include ReactiveCocoa and Result frameworks in TestApp target or test targets and it seems to work in simulator. Only problem is when I try to run the app on the device I get:\r\n\r\n```\r\ndyld: Library not loaded: @rpath/ReactiveCocoa.framework/ReactiveCocoa\r\n  Referenced from: /private/var/mobile/Containers/Bundle/Application/18D48163-7D97-43C1-A8D2-031B0EBF47D3/TestApp.app/Frameworks/TestAppKit.framework/TestAppKit\r\n  Reason: no suitable image found.  Did find:\r\n\t/private/var/mobile/Containers/Bundle/Application/18D48163-7D97-43C1-A8D2-031B0EBF47D3/TestApp.app/Frameworks/TestAppKit.framework/Frameworks/ReactiveCocoa.framework/ReactiveCocoa: mmap() error 1 at address=0x10126C000, size=0x00120000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/18D48163-7D97-43C1-A8D2-031B0EBF47D3/TestApp.app/Frameworks/TestAppKit.framework/Frameworks/ReactiveCocoa.framework/ReactiveCocoa\r\n```\r\n\r\nSo there is something wrong with the setup.\r\n\r\nTo summarise:\r\n\r\n- Is it possible to embed dependencies inside a framework?\r\n- If not, what is the correct setup? \r\n\r\nIf I add frameworks in app's \"Embedded Binaries\" and also have “Copy Frameworks\" step in my framework's build step like instructed in Carthage's readme, does the application bundle contain the frameworks twice?"},"comment":{"url":"https://api.github.com/repos/Carthage/Carthage/issues/comments/219410485","html_url":"https://github.com/Carthage/Carthage/issues/688#issuecomment-219410485","issue_url":"https://api.github.com/repos/Carthage/Carthage/issues/688","id":219410485,"user":{"login":"mdiep","id":1302,"avatar_url":"https://avatars.githubusercontent.com/u/1302?v=3","gravatar_id":"","url":"https://api.github.com/users/mdiep","html_url":"https://github.com/mdiep","followers_url":"https://api.github.com/users/mdiep/followers","following_url":"https://api.github.com/users/mdiep/following{/other_user}","gists_url":"https://api.github.com/users/mdiep/gists{/gist_id}","starred_url":"https://api.github.com/users/mdiep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdiep/subscriptions","organizations_url":"https://api.github.com/users/mdiep/orgs","repos_url":"https://api.github.com/users/mdiep/repos","events_url":"https://api.github.com/users/mdiep/events{/privacy}","received_events_url":"https://api.github.com/users/mdiep/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T12:09:54Z","updated_at":"2016-05-16T12:09:54Z","body":"> Without doing that, how should you be able to open a framework on its own to develop and build it?\r\n\r\nMost people have an `xcodeproj` that builds the framework with a shared scheme and a `xcworkspace` that includes that project and any dependent projects. You can look at any number of open source projects for an example, like [ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa) or [Tentacle](https://github.com/mdiep/Tentacle/).\r\n\r\nThis allows building, through the workspace, of a working copy of the framework. But it also allows consumers to include the project in their workspace and use different versions of the dependencies.\r\n\r\n> Although, if it is also intending to mean dependent .xcodeprojs from nested dependencies, how should you have them in the first place?\r\n\r\nYou can build the dependencies with `carthage build` or by using `carthage bootstrap --no-build` and including the projects in your framework's `xcworkspace`.\r\n\r\n> I came across this Thoughtbot article and I tried it (omitting the CocoaPods step) and building was unsuccessful. It couldn't find the dependent module at an import XXXX statement.\r\n\r\nThat article is a good one.\r\n\r\n\r\nI think you just need to add your dependencies to your frameworks workspace."}}