dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到

时间:2021-10-24 21:46:14

I'm using CocoaPods v0.36 with my Swift project and the following pods: Alamofire, CocoaLumberjack, SwiftyJSON.

我正在使用CocoaPods v0.36和我的Swift项目以及以下pod:Alamofire,CocoaLumberjack,SwiftyJSON。

Everything was fine till I used my Developer ID. Compiler started to have problems to compile the project, after some fixes and updates for CocoaPods my project compiles but at runtime I get the following error:

一切都很好,直到我使用我的开发者ID。编译器开始遇到编译项目的问题,在对CocoaPods进行一些修复和更新后,我的项目编译但在运行时我收到以下错误:

dyld: Library not loaded: @rpath/Alamofire.framework/Versions/A/Alamofire   
Referenced from: /Users/Ivan/Library/Developer/Xcode/DerivedData/myApp-bsxfcnwqpaxnzbhencwzteasshzf/Build/Products/Debug/myApp.app/Contents/MacOS/myApp  
Reason: image not found

I read different posts related to this:

我阅读了与此相关的不同帖子:

But none seems to solve the issue.

但似乎没有人能解决这个问题。

The only clue that I have is that the 3 frameworks are in red, so it seems that are not generated/linked.

我唯一的线索是3个框架是红色的,所以似乎没有生成/链接。

dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到

Now, I've removed my Developer ID, but the issue is still there. Does anybody have an idea?

现在,我删除了我的开发者ID,但问题仍然存在。有人有想法吗?

Edit: Solved Below the steps I did:

编辑:解决了我所做的步骤:

  1. pod deintegrate, pod update, pod install
  2. pod deintegrate,pod update,pod install

  3. Reimported the three swift library files (generated by cocoapods)
  4. 重新导入了三个swift库文件(由cocoapods生成)

  5. Imported the three frameworks only in the Linked Frameworks and Libraries
  6. 仅在链接框架和库中导入三个框架

  7. Full clean and a build
  8. 完全清洁和构建

6 个解决方案

#1


12  

dyld library not loaded @rpath/framework

dyld库没有加载@rpath / framework

please make sure that the framework is showing under target->general->embeded binaries and linked framework and libraries section

请确保框架显示在target-> general-> embeded二进制文件和链接的框架和库部分下

if not then add by clicking + sign add just add the framework only

如果没有,则单击+符号添加添加只添加框架

done!

#2


6  

Solved Below the steps I did:

解决了我所做的步骤:

  • pod deintegrate, pod update, pod install
  • pod deintegrate,pod update,pod install

  • Reimported the three swift library files (generated by cocoapods)
  • 重新导入了三个swift库文件(由cocoapods生成)

  • Imported the three frameworks only in the Linked Frameworks and Libraries
  • 仅在链接框架和库中导入三个框架

  • Full clean and a build
  • 完全清洁和构建

#3


3  

we were running into this issue here at work and one person's project would run while the other would get this strange error.

我们在这里遇到了这个问题,一个人的项目会运行而另一个人会遇到这个奇怪的错误。

We did some comparison and realized that error is being generated when in the Xcode project's target, under Build Phases its missing some of the run scripts that Cocoapods is supposed to generate.

我们做了一些比较并意识到在Xcode项目的目标中生成错误,在Build Phases下它缺少Cocoapods应该生成的一些运行脚本。

Check your project to make sure that these 3 scripts are there

检查您的项目以确保这3个脚本存在

Check Pods Manifest.lock
 Embed Pods Frameworks
 Copy Pods Resources

If they aren't I've attached a screenshot of them so that you can add them manually

如果不是,我附上了它们的截图,以便您可以手动添加它们

dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到 dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到 dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到

#4


1  

Make sure you have set valid certificate and provisioning profile in XCode!

确保您已在XCode中设置了有效的证书和配置文件!

#5


0  

I solved that trouble just by uncheck the "copy only when installing" on copy frameworks in Build Phases

我只是通过在Build Phases中复制框架上取消选中“仅在安装时复制”来解决这个问题

#6


0  

Solved by Unchecking Copy Only when installing. dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到

通过在安装时取消选中仅复制解决。

#1


12  

dyld library not loaded @rpath/framework

dyld库没有加载@rpath / framework

please make sure that the framework is showing under target->general->embeded binaries and linked framework and libraries section

请确保框架显示在target-> general-> embeded二进制文件和链接的框架和库部分下

if not then add by clicking + sign add just add the framework only

如果没有,则单击+符号添加添加只添加框架

done!

#2


6  

Solved Below the steps I did:

解决了我所做的步骤:

  • pod deintegrate, pod update, pod install
  • pod deintegrate,pod update,pod install

  • Reimported the three swift library files (generated by cocoapods)
  • 重新导入了三个swift库文件(由cocoapods生成)

  • Imported the three frameworks only in the Linked Frameworks and Libraries
  • 仅在链接框架和库中导入三个框架

  • Full clean and a build
  • 完全清洁和构建

#3


3  

we were running into this issue here at work and one person's project would run while the other would get this strange error.

我们在这里遇到了这个问题,一个人的项目会运行而另一个人会遇到这个奇怪的错误。

We did some comparison and realized that error is being generated when in the Xcode project's target, under Build Phases its missing some of the run scripts that Cocoapods is supposed to generate.

我们做了一些比较并意识到在Xcode项目的目标中生成错误,在Build Phases下它缺少Cocoapods应该生成的一些运行脚本。

Check your project to make sure that these 3 scripts are there

检查您的项目以确保这3个脚本存在

Check Pods Manifest.lock
 Embed Pods Frameworks
 Copy Pods Resources

If they aren't I've attached a screenshot of them so that you can add them manually

如果不是,我附上了它们的截图,以便您可以手动添加它们

dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到 dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到 dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到

#4


1  

Make sure you have set valid certificate and provisioning profile in XCode!

确保您已在XCode中设置了有效的证书和配置文件!

#5


0  

I solved that trouble just by uncheck the "copy only when installing" on copy frameworks in Build Phases

我只是通过在Build Phases中复制框架上取消选中“仅在安装时复制”来解决这个问题

#6


0  

Solved by Unchecking Copy Only when installing. dyld:未加载库:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:图片未找到

通过在安装时取消选中仅复制解决。