Cocoapods +命令行工具 - dyld:未加载库:@ rpath / Realm.framework / Versions / A / Realm

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

I created a Command Line Tool project in Xcode 8.2.1, then I ran pod init and added RealmSwift to it. After pod install, I opened the .xcworkspace file.

我在Xcode 8.2.1中创建了一个命令行工具项目,然后我运行了pod init并向其添加了RealmSwift。安装pod后,我打开了.xcworkspace文件。

The project compiles fine, but at runtime I get the following error:

该项目编译良好,但在运行时我收到以下错误:

dyld: Library not loaded: @rpath/Realm.framework/Versions/A/Realm
Referenced from: /Users/myuser/Library/Developer/Xcode/DerivedData/myproject-eqotetgxsfjvxjfevywenvddnfdm/Build/Products/Debug/myproject
Reason: image not found
Program ended with exit code: 9

How can I use cocoapods here?

我怎么在这里使用cocoapods?

2 个解决方案

#1


1  

https://github.com/CocoaPods/CocoaPods/issues/3707

In other words cocoa pods don't work with "Command Line Tool" projects.

换句话说,可可豆荚不适用于“命令行工具”项目。

#2


0  

Please make sure your project setting under Link Binary with Libraries as 'Optional' not as 'Required' for Pod_PROJECT-NAME.framework

请确保将Link Binary with Libraries下的项目设置为“Optional”,而不是“Pod_PROJECT-NAME.framework”的“Required”项目设置

Cocoapods +命令行工具 -  dyld:未加载库:@ rpath / Realm.framework / Versions / A / Realm

#1


1  

https://github.com/CocoaPods/CocoaPods/issues/3707

In other words cocoa pods don't work with "Command Line Tool" projects.

换句话说,可可豆荚不适用于“命令行工具”项目。

#2


0  

Please make sure your project setting under Link Binary with Libraries as 'Optional' not as 'Required' for Pod_PROJECT-NAME.framework

请确保将Link Binary with Libraries下的项目设置为“Optional”,而不是“Pod_PROJECT-NAME.framework”的“Required”项目设置

Cocoapods +命令行工具 -  dyld:未加载库:@ rpath / Realm.framework / Versions / A / Realm