9

I have a project containing another target(framework) which is a dependency of the main project. That framework requires it's own frameworks, so I've added them using carthage. The project compiles and runs fine on simulator, however I'm getting the following error when running it on a physical device:

dyld: Library not loaded: @rpath/Subframework.framework/Subframework
  Referenced from: /private/var/mobile/Containers/Bundle/Application/LONG-ID/MyApp.app/Frameworks/MyAppSDK.framework/MyAppSDK
  Reason: no suitable image found.  Did find:
    /private/var/mobile/Containers/Bundle/Application/LONG-ID/MyApp.app/Frameworks/MyAppSDK.framework/Frameworks/Subframework.framework/Subframework: mmap() error 1 at address=0x00798000, size=0x00060000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/LONG-ID/MyApp.app/Frameworks/MyAppSDK.framework/Frameworks/Subframework.framework/Subframework

I have tried this, however the only solution is to add the Subframework to "Embed frameworks" to top level project, which is not viable. I've tried modifying Build Settings -> Linking -> Dynamic Library Install name, however it didn't help.

How can achieve make it work on the iphone?

Community
  • 1
  • 1
user_4685247
  • 2,878
  • 2
  • 17
  • 43

1 Answers1

0

I was also facing this issue for some time and I had a three level hierarchy where the outer most 'Umbrella Framework' should not be distributed with the other frameworks. How I resolved it was by setting the 'Run Search Paths' under 'Linking' in 'Build Settings' of each of the 'Umbrella Framework' to point to the 'Copy Files' destination that is set in the 'Build Phases' (You have to add a 'Copy Files' build phase and preferable set its' destination to 'Frameworks', then add each 'Sub-framework' you want to embed).

Copy sub-framework to 'Frameworks'

Set 'Runpath Search Paths' to 'Frameworks'

dev_exo
  • 164
  • 1
  • 8
  • After having this arrangement in my application, the Application Loader refused to upload the ipa with error messages: 'ERROR ITMS-90205: "Invalid bundle. The bundle at 'appname.ipa/Frameworks/umbrellaFramework.framework' contains disallowed nested bundles".' and 'ERROR ITMS-90205: "Invalid bundle. The bundle at 'appname.ipa/Frameworks/umbrellaFramework.framework' contains disallowed file 'Frameworks'".'. I ended up letting the umbrella framework be compiled with the sub-frameworks and move the sub-frameworks out it after compilation and embed them to the project. Also delete 'Frameworks' dir. – dev_exo Mar 27 '17 at 14:10