我正在为我的 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/