简体   繁体   English

iOS:dyld:未加载库:@ rpath / CocoaLumberjack.framework / CocoaLumberjack

[英]iOS: dyld: Library not loaded: @rpath/CocoaLumberjack.framework/CocoaLumberjack

I'm trying to implement CocoaLumberjack as framework and it works fine on the simulator but when try to use it on my iPhone I'm getting this error: 我正在尝试将CocoaLumberjack实现为框架,并且在模拟器上可以正常工作,但是当尝试在iPhone上使用它时,出现此错误:

dyld: Library not loaded: @rpath/CocoaLumberjack.framework/CocoaLumberjack
  Referenced from: /var/containers/Bundle/Application/3EF12D55/myApp.app/CocoaLumberjackSample
  Reason: image not found

Any of you knows why the difference between the simulator and the device? 你们都知道为什么模拟器和设备之间的区别吗?

I'll really appreciate your help. 非常感谢您的帮助。

Well, the difference is simple: 好吧,区别很简单:

Whenever you run your app in simulator it can access any other build products in the same build folder, eg, frameworks. 每当您在模拟器中运行应用程序时,它都可以访问同一构建文件夹中的任何其他构建产品,例如框架。 That's why you do not experience this problem in simulator. 这就是为什么您在模拟器中没有遇到此问题的原因。 On your iOS device that is different story because Xcode only copies the actual app bundle to your device. 在您的iOS设备上,情况有所不同,因为Xcode仅将实际的应用捆绑包复制到您的设备上。 So in order to make it work you need to add CocoaLumberjack.framework to the Embed Frameworks build phase. 因此,为了使其工作,您需要将CocoaLumberjack.framework添加到Embed Frameworks构建阶段。 This will copy the framework into the Frameworks subfolder in the app bundle so that your app binary can find it. 这会将框架复制到应用程序捆绑包中的Frameworks子文件夹中,以便您的应用程序二进制文件可以找到它。

在此处输入图片说明

If you do not have the Embed Frameworks build phase you can either add a New Copy Files Build Phase via the add button in the top left of the build phases tab and then select Frameworks as destination. 如果您没有Embed Frameworks构建阶段,则可以通过构建阶段选项卡左上角的添加按钮添加“ New Copy Files Build Phase ”构建阶段,然后选择“ Frameworks作为目标。 The other option is to select the General tab, scroll down and then add your framework under the Embedded Binaries section. 另一个选项是选择“常规”选项卡,向下滚动,然后在“ Embedded Binaries部分下添加您的框架。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 dyld:库未加载:@rpath 与 iOS8 - dyld: Library not loaded: @rpath with iOS8 自定义框架未加载dyld:库未加载:@rpath / Custom.framework / - Custom framework not loaded dyld: Library not loaded: @rpath/Custom.framework/ 在iOS 8 app / framework中缺少必需的模块'CocoaLumberjack' - Missing required module 'CocoaLumberjack' in iOS 8 app / framework iOS CocoaLumberjack日志记录框架未记录到设备上的文件 - iOS CocoaLumberjack logging framework not logging to a file on device dyld:未加载库:@ rpath / MyDSK.framework / MyDSK - > SWIFT iOS 8.0 - dyld: Library not loaded: @rpath/MyDSK.framework/MyDSK -> SWIFT iOS 8.0 iOS:dyld:库未加载:@rpath/libswiftWebKit.dylib 使用 Cocoa Touch Framework 中的 SwiftyDropbox 时 - iOS: dyld: Library not loaded: @rpath/libswiftWebKit.dylib when using SwiftyDropbox from Cocoa Touch Framework dyld:库未加载:设备iOS 9上的@ rpath / Alamofire.framework / Alamofire错误,无法编译 - dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire error on device iOS 9 , not able to compile swift + firebase,ios 14 - SIGABRT dyld:库未加载:@rLPromises/FBLPromises.framework/ - swift + firebase, ios 14 - SIGABRT dyld: Library not loaded: @rpath/FBLPromises.framework/FBLPromises dyld:未加载库:@ rpath / SwiftyJSON.framework / SwiftyJSON - dyld: Library not loaded: @rpath/SwiftyJSON.framework/SwiftyJSON dyld:库未加载:@ rpath / SwiftyJSON.framework / SwiftyJSON - dyld: Library not loaded: @rpath/SwiftyJSON.framework/SwiftyJSON
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM