xcode cocoapods 同步:ld:未找到框架 DATAFilter,链接器命令失败,退出代码为 1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38370444/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:02:41  来源:igfitidea点击:

cocoapods Sync: ld: framework not found DATAFilter, linker command failed with exit code 1

iosswiftxcodecore-datacocoapods

提问by kolisko

I am trying to get Sync (https://github.com/hyperoslo/Sync) to work in my 'em' Xcode iOS Swift project. I have experience with Carthage for framework dependency so it is my cocoapods premiere.

我正在尝试让 Sync ( https://github.com/hyperoslo/Sync) 在我的 'em' Xcode iOS Swift 项目中工作。我有使用 Carthage 进行框架依赖的经验,所以这是我的 cocoapods 首演。

my Podfile

我的播客文件

use_frameworks!

target "em" do
    pod 'Sync'
end

my Pods dir:

我的 Pod 目录:

Michal-MBP:em kolisko$ v Pods
total 24
drwxr-xr-x  16 kolisko  staff   544 14 ?vc 10:27 ./
drwxr-xr-x  14 kolisko  staff   476 14 ?vc 09:21 ../
-rw-r--r--@  1 kolisko  staff  6148 14 ?vc 10:27 .DS_Store
drwxr-xr-x   5 kolisko  staff   170 14 ?vc 09:20 DATAFilter/
drwxr-xr-x   5 kolisko  staff   170 14 ?vc 09:20 DATAObjectIDs/
drwxr-xr-x   5 kolisko  staff   170 14 ?vc 09:20 DATAStack/
drwxr-xr-x   2 kolisko  staff    68 14 ?vc 09:20 Headers/
drwxr-xr-x   2 kolisko  staff    68 14 ?vc 00:42 Local Podspecs/
-rw-r--r--   1 kolisko  staff  1262 14 ?vc 09:21 Manifest.lock
drwxr-xr-x   5 kolisko  staff   170 14 ?vc 09:20 NSDictionary-ANDYSafeValue/
drwxr-xr-x   5 kolisko  staff   170 14 ?vc 09:20 NSEntityDescription-SYNCPrimaryKey/
drwxr-xr-x   5 kolisko  staff   170 14 ?vc 09:21 NSManagedObject-HYPPropertyMapper/
drwxr-xr-x   5 kolisko  staff   170 14 ?vc 09:21 NSString-HYPNetworking/
drwxr-xr-x   4 kolisko  staff   136 14 ?vc 09:21 Pods.xcodeproj/
drwxr-xr-x   5 kolisko  staff   170 14 ?vc 09:21 Sync/
drwxr-xr-x  11 kolisko  staff   374 14 ?vc 09:21 Target Support Files/
Michal-MBP:em kolisko$ 

Xcode 7.3.1 build error output

Xcode 7.3.1 构建错误输出

ld: warning: directory not found for option '-F/Users/kolisko/Library/Developer/Xcode/DerivedData/em-btqhzuiyxahnvqeznjrrilcusqnm/Build/Products/Debug-iphonesimulator/DATAFilter'
ld: warning: directory not found for option '-F/Users/kolisko/Library/Developer/Xcode/DerivedData/em-btqhzuiyxahnvqeznjrrilcusqnm/Build/Products/Debug-iphonesimulator/DATAObjectIDs'
ld: warning: directory not found for option '-F/Users/kolisko/Library/Developer/Xcode/DerivedData/em-btqhzuiyxahnvqeznjrrilcusqnm/Build/Products/Debug-iphonesimulator/DATAStack'
ld: warning: directory not found for option '-F/Users/kolisko/Library/Developer/Xcode/DerivedData/em-btqhzuiyxahnvqeznjrrilcusqnm/Build/Products/Debug-iphonesimulator/NSDictionary-ANDYSafeValue'
ld: warning: directory not found for option '-F/Users/kolisko/Library/Developer/Xcode/DerivedData/em-btqhzuiyxahnvqeznjrrilcusqnm/Build/Products/Debug-iphonesimulator/NSEntityDescription-SYNCPrimaryKey'
ld: warning: directory not found for option '-F/Users/kolisko/Library/Developer/Xcode/DerivedData/em-btqhzuiyxahnvqeznjrrilcusqnm/Build/Products/Debug-iphonesimulator/NSManagedObject-HYPPropertyMapper'
ld: warning: directory not found for option '-F/Users/kolisko/Library/Developer/Xcode/DerivedData/em-btqhzuiyxahnvqeznjrrilcusqnm/Build/Products/Debug-iphonesimulator/NSString-HYPNetworking'
ld: warning: directory not found for option '-F/Users/kolisko/Library/Developer/Xcode/DerivedData/em-btqhzuiyxahnvqeznjrrilcusqnm/Build/Products/Debug-iphonesimulator/Sync'

ld: framework not found DATAFilter
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My question is - Is neccessary somehow manually link the DATAFilter framework?

我的问题是 - 是否需要以某种方式手动链接 DATAFilter 框架?

回答by kolisko

SOLVED

解决了

it is neccessary to open the project 'em' as

必须将项目“em”打开为

open em.xcworkspace

打开它们。工作空间

and NOT

并不是

open em.xcodeproj

打开它们。xcodeproj

回答by chacpk

This makes me go crazy at least i spend 10 hours finding a solution and was not to open .xcworkspace, it was the first thing i did (hour 0) and then 9 hours of a crazy nigthmare

这让我发疯,至少我花了 10 个小时寻找解决方案,而不是打开 .xcworkspace,这是我做的第一件事(0 小时),然后是 9 个小时的疯狂噩梦

Well here my solution: Go selecting your project Go Build Settings> Other Linker Flagsand simple remove -framework(watch-out its separated in two separated lines, thats why a find does not work) and DATAFilter(second line) and voila!

好吧,我的解决方案是:选择您的项目 Go Build Settings> Other Linker Flags和简单的 remove -framework(注意它在两行分开,这就是 find 不起作用的原因)和DATAFilter(第二行),瞧!