Custom framework not loaded dyld: Library not loaded: @rpath/Custom.framework/

自闭症网瘾萝莉.ら 提交于 2019-12-05 18:15:31

I didn't stop figuring out the cause of the issue until I read about architectures. So it prompted me to build the frameworks while an iPhone 6 is connected. I created a project with all the defaults. Added a couple of frameworks including Alamofire. Built them while iPhone 6 connected. Generated an archive and deployed and installed OTA. When the app was installed it ran without issues.

I tried to confirm it by building against my iPod(MD717ZP/A). I'm not sure if this was 5th Gen. First I emptied the derived data folder, Cleaned all projects including the frameworks. Built and deployed the app. Installed it on the iPod it was running. I installed it on the iPhone 6 and it crashed instantly.

I tried the same process over and over again. Built against iPhone 6 then iPod then installed on both. The results just confirmed that I need to have it built on iPhone 6 so the app would run on that device and lower.

Remember I ONLY did add the frameworks to "Embedded Binaries" (Target > General > Embedded Binaries) then built on iPhone 6 to make it work. This could mean you need to have the latest device if you want it running on all devices due to some architecture requirements.

Update: In addition to the knowledge above you may want to check the "Build Active Architecture Only" section in the Build Settings tab. It means it will build based on the connected hardware if set to YES else it will build for the architectures you support like Valid Architectures.

I had same issue with xcode 10 with Mojave & I am using Cocoa pods, here are my solution :

  1. Make sure your target->build settings->iOS Deployment Target is set to the latest IOS.
  2. In Pod file, remove "inherit! :search_paths" for the test UI target. For Eg.
Existing pod file :

    target 'MyApp' do
        pod 'oAuthorize'
        target 'MyUITest1' do
            inherit! :search_paths
        end
        target 'MyFunctionalTest' do
            inherit! :search_paths
        end
    end
    Remove "inherit! :search_paths" for all sub-targets. 

    target 'MyApplication' do
        pod 'oAuthorize'
        target 'MyUITest1' do
        end
        target 'MyFunctionalTest' do
        end
    end

Check the Linking section in the Build Settings tab, following item may not been set:

Runpath Search Paths = @executable_path/Frameworks
  • This fixed an error for me:

    dyld: library not loaded: @rpath/CorePlot.framework/CorePlot
    reason: image not found
    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!