2016-01-06 122 views
4

我正在尝试将Google登录集成到我的iOS应用中,但在执行此操作时我收到了以下错误。尝试安装Google登录时出现链接错误

有没有解决方案可以消除以下错误?

Undefined symbols for architecture armv7: "_inflate", referenced from: l002 in GoogleSignIn(GTMNSData+zlib.o) "_deflate", referenced from: l001 in GoogleSignIn(GTMNSData+zlib.o) "_inflateEnd", referenced from: l002 in GoogleSignIn(GTMNSData+zlib.o) "deflateInit2", referenced from: l001 in GoogleSignIn(GTMNSData+zlib.o) "inflateInit2", referenced from: l002 in GoogleSignIn(GTMNSData+zlib.o) "_deflateEnd", referenced from: l001 in GoogleSignIn(GTMNSData+zlib.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

+1

我建议你使用**的CocoaPods **安装框架。 – iphonic

回答

2

您可以在下面的步骤休耕

  1. 去盖设置/链接/其它链接器标记,并添加“-ObjC”不带引号。这假设你正在使用一些“头文件

    文件”来映射谷歌框架和Swift方法。

  2. 前往构建阶段>链接二进制与Librairies> +>添加其它的去脱/ usr/lib目录,选择 “libz.dylib”

  3. 编译

6

这是很常见的错误,并没有任何具体的解决方案。虽然可能是以下解决方法可以帮助你:

  1. If you are not using cocoa-pods use them to add new repos.

  2. Check that you haven't imported .m instead of .h .

  3. Check you haven't add two frameworks accidenlty.

  4. Remove -ObjC Linker flag from `-otherLinkerFlags'

  5. Sometimes using older version of sdk may solve the problem.

  6. Navigate to YourProject--Build Phases and check you haven't added one file more than once. And also any Link Binary and Libraries are not missing from there.

enter image description here

这里是图像显示OtherLinkerFlags

Other Linker Flag Discription

如需详细资料请参阅this链接

好运。 .. :)

+0

谢谢Rahul Mishra第四选项为我工作。 –

+0

@VikramPote我很高兴它可以帮助..当我遇到这个问题时,我坚持了3个该死的日子......并且找不到解决方案...... :( – Dalvik

1

添加-ObjClibz解决了我的问题。但在我的情况下,我找不到路径/usr/bin中的libz.dylib。我在iOS 9.3文件夹中使用了libz.tbd,而且它也可以正常工作,并解决了这些相同的错误。

screenshot of adding the library

相关问题