xcode cocoapods 0.37.1 - 更新 Podfile 时,框架不再链接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30363402/
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 07:10:38  来源:igfitidea点击:

cocoapods 0.37.1 - when updating Podfile, frameworks are no longer linked

iosxcodeswiftparse-platformcocoapods

提问by damianesteban

I've been struggling with this for a few days now on and off and I could use some guidance.

我已经断断续续地为此苦苦挣扎了几天,我可以使用一些指导。

Below is the contents of my original Podfile:

以下是我的原始 Podfile 的内容:

pod 'Parse', '~> 1.7.1'
pod 'ParseUI', '~> 1.1.3'
pod 'ParseCrashReporting'

Everything was working fine until the other day when I decided to add some more pods. Here is what my Podfile looks like now:

一切都很好,直到有一天我决定添加更多豆荚。这是我的 Podfile 现在的样子:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!


pod 'Parse', '~> 1.7.1'
pod 'ParseUI', '~> 1.1.3'
pod 'ParseCrashReporting'
pod 'Alamofire', '~> 1.2'

As you can see, I am attempting to add Alamofire. When I do a

如您所见,我正在尝试添加 Alamofire。当我做一个

$ pod update $ pod install

$ pod update $ pod install

it appears that everything installs ok. However, when I open up my project in Xcode and it finishes indexing, all hell has broken loose (well, not really).

看来一切安装正常。然而,当我在 Xcode 中打开我的项目并完成索引时,一切都变得混乱了(好吧,不是真的)。

It seems that Parse is no longer linked to my project, as I have 50+ errors along the lines of:

似乎 Parse 不再与我的项目相关联,因为我有 50 多个错误:

Use of undeclared type 'PFLogInViewController'

Use of undeclared type 'PFLogInViewController'

I'm not at all new to Ruby/Gemfiles or the command line, but I am fairly new to Xcode and Cocoapods.

我对 Ruby/Gemfiles 或命令行一点都不陌生,但我对 Xcode 和 Cocoapods 相当陌生。

Any help would be appreciated. Thank you.

任何帮助,将不胜感激。谢谢你。

EDIT: Below is my bridging header.

编辑:下面是我的桥接头。

// Objective-C Bridging File
#import <Foundation/Foundation.h>
#import <Parse/Parse.h>
#import <ParseCrashReporting/ParseCrashReporting.h>
#import <ParseUI/ParseUI.h>
#import <Bolts/Bolts.h>

EDIT:

编辑:

I am getting the following error after I do a pod install:

执行以下操作后出现以下错误pod install

Error: unable to read module map contents from 'Target Support Files/Pods-Parse/Pods-Parse.modulemap': Error Domain=NSCocoaErrorDomain Code=260 "The file “Pods-Parse.modulemap” couldn't be opened because there is no such file." UserInfo=0x7fc988cd4920 {NSFilePath=/Volumes/BigMan/Code/Swift/ProjectName/Pods/Target Support Files/Pods-Parse/Pods-Parse.modulemap, NSUnderlyingError=0x7fc98ac96850 "The operation couldn't be completed. No such file or directory"}

采纳答案by Jakub Vano

Bridging header is necessary only if you are building CocoaPods to static library. After switching to frameworks, you should use import ParseUIin your source files instead.

仅当您将 CocoaPods 构建到静态库时才需要桥接标头。切换到框架后,您应该import ParseUI在源文件中使用。

回答by BlackHatSamurai

Doing a pod installworked for me to resolve this issue. Sometimes when working with a team, other pods can get installed.

做一个pod install对我有用的工作来解决这个问题。有时与团队合作时,可以安装其他 pod。

回答by Jose Ramirez

1) After deleting the pod files, I tried pod installagain.

1)删除pod文件后,我pod install再次尝试。

2) I still got the error.

2)我仍然遇到错误。

3) tried pod installagain.

3)pod install再试一次。

4) Then I did pod repo update

4)然后我做了 pod repo update

And it worked.

它奏效了。