且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

dyld:库没有加载cocoapods 0.37和Xcode 6.3

更新时间:2023-02-22 10:57:36

重新安装整个系统并找不到解决方案后,我发现有些为CocoaPods构建强制阶段正确地丢失了。



此问题的解决方案适用于下一步:


  1. 解体cocoapods项目(您可以使用 sudo gem install cocoapods-deintegrate 安装该工具)。

cocoapods-在Github上解体


  1. 修改你的Podfile:



    您应该定义目标链接 link_with'ProjectName'



    您应该定义你的pod的目标: target'ProjectName'do [pods here] end


  2. 使用 pod install进行安装


  3. 执行此操作后,转到XCode并检查以下设置:



    在项目设置中的配置下,检查在Debug和Release中是否有一个名为 Pods-ProjectName。[debug | release]



    进入你的目标,在Build Phases下你应该有三个新的阶段应命名为: Check Pods Manifest Embed Pods Frameworks 复制Pod资源


  4. 制作一个干净的,然后构建,然后进入你的设备。


就是这样。


I've been reading all the issues about the error:

dyld: Library not loaded: @rpath/Bolts.framework/Bolts Referenced from: /private/var/mobile/Containers/Bundle/Application/1542F906-CCE1-4181-AC7C-B5E3EE50E7D7/eBikeMotion.app/eBikeMotion Reason: no suitable image found. Did find:

Which makes my application unable to run in a real device (but it runs without any problem in the simulator. Until certain point I thought that it was an issue with the frameworks I was installing, but after installing manually the original one that was throwing the error, Alamofire, and the next Framework throwing the error was the next one in alphabetical order (Bolts, as you can see in the code snippet) So I've reached the conclusion that is indeed CocoaPods which is producing these errors. I've got the last version (0.37) with a clean install, Iv'e tried to create a new project, I've tried all the proposed solutions to this issue without any luck, so I have to open an issue, with the hope that someone can help me.

Regards.

After reinstalling the whole system and don't finding a solution, I've found that some of the Build Phases mandatory for CocoaPods to run properly were missing.

The solution for this problem goes for the next steps:

  1. Deintegrate the cocoapods project (you can install the tool with sudo gem install cocoapods-deintegrate).

cocoapods-deintegrate on Github

  1. Modify your Podfile:

    You should define your target linking with link_with 'ProjectName'.

    You should define the target for your pods: target 'ProjectName' do [pods here] end.

  2. Make an install with pod install

  3. After doing this, go to XCode and check the following settings:

    Into project settings, under "Configurations" check that in Debug and Release you've got a Configuration set named Pods-ProjectName.[debug|release]

    Into your target, under "Build Phases" you should have three new phases that should be named: Check Pods Manifest, Embed Pods Frameworks and Copy Pods Resources.

  4. Make a clean, then build, then run into your device.

That's it.