ios - 使用 Google 登录时链接器命令失败,退出代码为 1

标签 ios objective-c xcode cocoapods google-signin

我正在为我的 iOS 应用程序使用 Google 登录。这是在 Xcode 7 中。我遵循了网站上的所有说明。我做了 pod init,将 pod 'Google/SignIn' 放入 Podfile,运行 pod install,下载配置文件并将其拖到项目中,将 REVERSED_CLIENT_ID 放入 into.plist 的 URL Schemes 中。我将所有内容都放入了 AppDelegate.m。我也在使用 Facebook 登录,所以我输入的不是他们告诉我的内容:

- (BOOL)application:(UIApplication *)application
        openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
     annotation:(id)annotation {

    return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                      openURL:url
                                            sourceApplication:sourceApplication
                                                   annotation:annotation] || [[GIDSignIn sharedInstance] handleURL:url
                                                                                                 sourceApplication:sourceApplication
                                                                                                        annotation:annotation];
}

但是,我收到以下错误:

ld: library not found for -lPods-APP_NAME
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我尝试将 $(PROJECT_DIR) 添加到框架搜索路径并将其标记为递归,但这没有用。有人知道会发生什么吗?

编辑:当我运行 pod install 时,我看到以下消息:

[!] The `Piste [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-Piste/Pods-Piste.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

[!] The `Piste [Release]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-Piste/Pods-Piste.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

最佳答案

尝试清理您的项目。如果这不起作用,请尝试再运行一次 pod install。另外,请记住在使用 cocoapods 运行项目时仅使用 .xcworkspace。

关于ios - 使用 Google 登录时链接器命令失败,退出代码为 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38104244/

相关文章:

iphone - 如何在不使用开放图谱API的情况下在Facebook墙上发布图像和文本

ios - 从图库中选择一张照片并在另一个 View 中打开它

swift - 在表格 View 单元格中长按时传递数据

objective-c - MKAnnotation 未在 MKMapView 上显示标注

iphone - UIAutomation 脚本示例

ios - SwiftUI [Presentation]/尝试在...上展示 View 已经在展示

iOS 将极坐标定义的区域转换为 NxN 矩阵

ios - iPhone 5 可以运行 64 位应用程序吗?

ios - 如何使用 slider 更改 UILabel

ios - iPad ios6 中的方向问题