简体   繁体   English

dyld:未加载库:@ rpath / FMDB.framework / FMDB

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

I am using Xcode 7.2 and swift 2. Deployment target is ios 9.0 我正在使用Xcode 7.2和swift 2.部署目标是ios 9.0

The question is similar to many previous questions being asked, but my issue is not common or did not find any reference to any of them. 问题类似于之前提出的许多问题,但我的问题并不常见,或者没有找到任何问题。

I have created a cocoa touch framework for iOS which has mixed code ( both swift and objC) and has some libraries included from Cocoapods. 我已经为iOS创建了一个可可触摸框架,它具有混合代码(包括swift和objC),并且包含一些来自Cocoapods的库。 ( FMDB, ObjectMapper, HockeySDK ) (FMDB,ObjectMapper,HockeySDK)

I have another target in the same project which has a sample application where I include my framework. 我在同一个项目中有另一个目标,它有一个示例应用程序,其中包含我的框架。 Now, when I try to run it on my device it throws me this runtime error just after installation, 现在,当我尝试在我的设备上运行它时,它会在安装后立即抛出此运行时错误

dyld: Library not loaded: @rpath/FMDB.framework/FMDB Referenced from: /private/var/mobile/Containers/Bundle/Application/0A768355-B7F9-4B1C-AE0D-D2ED57A7E1D6/SwiftExample.app/Frameworks/MyFramework.framework/MyFramework Reason: image not found. dyld:未加载库:@ rpath / FMDB.framework / FMDB引用自:/private/var/mobile/Containers/Bundle/Application/0A768355-B7F9-4B1C-AE0D-D2ED57A7E1D6/SwiftExample.app/Frameworks/MyFramework.framework/ MyFramework原因:找不到图像。

I have tried all these actions: 我尝试过所有这些动作:

  • Restarting Xcode, iPhone, computer 重启Xcode,iPhone,电脑
  • Clean & Build, project 清洁和建造,项目
  • Runpath Search Paths is '$(inherited) @executable_path/Frameworks' Runpath搜索路径是'$(继承)@ executable_path / Frameworks'
  • Embedded Content Contains Swift Code is 'Yes' 嵌入式内容包含Swift Code是'是'

My PodFile has the following desc : 我的PodFile有以下desc:

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

platform :ios, '9.0'

xcodeproj 'MyFramework'

target :'MyFramework' do
    pod 'HockeySDK', '~> 3.8.4'
    pod 'FMDB'
    pod 'OpenSSL-iOS', '~> 1.0'
    pod 'GoogleAnalytics'
    pod 'ObjectMapper', '~> 1.0'
end

Is there something I am missing or doing wrong ? 有什么我遗失或做错了吗?

I had the same problem this morning. 今天早上我遇到了同样的问题。 I solved it by (1) compiling the FMDB framework in statically-linked, not dynamically-linked, mode; 我通过(1)以静态链接,非动态链接模式编译FMDB框架来解决它; and (2) adding the link to "libsqlite3.dylib" library in the frameworks section of my application program. (2)在我的应用程序的框架部分中添加“libsqlite3.dylib”库的链接。

To do (1), in XCode, open the FMDB framework project, and in the Project editor, under the framework's Build Settings tab, in the Linking subsection, change the Mach-O Type to Static Library, and re-build the framework. 要做(1),在XCode中,打开FMDB框架项目,在项目编辑器中,在框架的Build Settings选项卡下,在Linking子部分中,将Mach-O Type更改为Static Library,并重新构建框架。

To do (2), again in XCode, open your application project, and in the Project editor, under the application's General tab, in the "Linked Frameworks and Libraries" subsection, add "libsqlite3.dylib". 要执行(2),再次在XCode中打开您的应用程序项目,并在项目编辑器中,在应用程序的“常规”选项卡下的“链接的框架和库”子部分中,添加“libsqlite3.dylib”。

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

相关问题 自定义框架未加载dyld:库未加载:@rpath / Custom.framework / - Custom framework not loaded dyld: Library not loaded: @rpath/Custom.framework/ dyld:未加载库:@ rpath / Alamofire.framework / Alamofire - dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire dyld:库未加载:@rpath/MapboxMobileEvents.framework/MapboxMobileEvents - dyld: Library not loaded: @rpath/MapboxMobileEvents.framework/MapboxMobileEvents dyld:库未加载:XCode 11.3.1 中的@rpath/FBLPromises.framework/FBLPromises - dyld: Library not loaded: @rpath/FBLPromises.framework/FBLPromises in XCode 11.3.1 dyld:未加载库:@ rpath / SinchVerification.framework / SinchVerification - dyld: Library not loaded: @rpath/SinchVerification.framework/SinchVerification dyld:库未加载:@ rpath / JSONModel.framework / JSONModel - dyld: Library not loaded: @rpath/JSONModel.framework/JSONModel dyld:未加载库:@ rpath / Mapbox.framework / Mapbox - dyld: Library not loaded: @rpath/Mapbox.framework/Mapbox 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 dyld:库未加载:@rpath/Alamofire.framework/Alamofire 图像未找到 - dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire image not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM