Linking errors when trying to install Google signin

感情迁移 提交于 2020-01-23 06:46:11

问题


I am trying to integrate Google Sign In into my iOS Apps but while doing this i am getting below error.

Is there any solution to remove below errors?

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:


You can fallow below steps

  1. Go to Build settings / Linking / Other Linker Flags and add the "-ObjC" without the quotes. This assume you are using some "header

    file" to map Google framework and for Swift approach.

  2. Go to Build Phases >Link Binary with Librairies > + > Add other, the go to de /usr/lib directory and select "libz.dylib"

  3. Compile




回答2:


This is very common error and doesn't have any specific solution. Although may be following workaround may help you:

  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.

Here is the Image Showing OtherLinkerFlags

For More Detail Refer to this Link

Good Luck... :)




回答3:


Adding -ObjC and libz solved my problem. However in my case I can't find libz.dylib in path /usr/bin. I used libz.tbd in the iOS 9.3 folder instead and it also worked fine and dismissed those same errors.



来源:https://stackoverflow.com/questions/34626342/linking-errors-when-trying-to-install-google-signin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!