问题
Google just updated their sign in library for ios to version 3.0.0.
In the process, it looks like they also caused the library to fail to build with the error ld: file not found: MY_APP_PATH/Pods/GoogleUtilities/Libraries/libGTM_NSData+zlib.a
What can I do to solve this? I'm using Cocoapods.
回答1:
I mostly made this question so that there's a google-able answer on how to fix this issue.
Like I stated in the question above, the issue is caused by the March 22 2016 v3.0.0 update of the Google iOS libraries.
What I believe caused my build error
The Google Signin Podspec v3.0.0 (I don't actually recommend you follow that link given the performance issues surrounding how the Cocoapods ecosystem is architected) lists the library GoogleUtilities
as a dependency.
"dependencies": {
"GoogleUtilities": [
"~> 1.0"
],
The GoogleUtilities
Podspec v1.2.0 makes these files available to those who import it:
"vendored_libraries": [
"Libraries/libGTM_iPhone_external.a",
"Libraries/libGTM_core_external.a",
"Libraries/libGTM_UIFont+LineHeight_external.a",
"Libraries/libGTM_SystemVersion_external.a",
"Libraries/libGTM_StringEncoding_external.a",
"Libraries/libGTM_RoundedRectPath_external.a",
"Libraries/libGTM_Regex_external.a",
"Libraries/libGTM_NSStringXML_external.a",
"Libraries/libGTM_NSStringHTML_external.a",
"Libraries/libGTM_NSScannerJSON_external.a",
"Libraries/libGTM_NSDictionary+URLArguments_external.a",
"Libraries/libGTM_NSData+zlib_external.a",
"Libraries/libGTM_KVO_external.a",
"Libraries/libGTM_GTMURLBuilder_external.a",
"Libraries/libGTM_DebugUtils_external.a",
"Libraries/libGTM_AddressBook_external.a",
"Libraries/libGTMStackTrace_external.a"
],
Notice that GoogleUtilities
does not make libGTM_NSData+zlib
available. It's likely that the previous version of GoogleUtilityies
did make that file available, but I'm not able to confirm that by looking at the previous version of the podspec due to the performance issues mentioned above.
How I fixed my build error
I fixed the build error by rolling my GoogleSignIn dependency back to the previous version, 2.4.0
.
To do that, open your Podfile and replace
pod 'Google/SignIn'
with
pod 'GoogleSignIn', '2.4.0'
Do a project-wide search and replace that replaces <Google/SignIn.h>
with <GoogleSignIn.h>
.
回答2:
Unfortunately the GoogleSignIn 3.0.0 release requires a newer version of some dependencies - running pod install
wont pick up them up though, as they still satisfy the matching in the Podspec.
Could you try running pod update
- that should fetch the latest version of all libraries.
回答3:
I've found that simply have to specify a previous version of GoogleUtilities
in the Podfile of your application or where you are making the dependency with Google SignIn.
Like 'GoogleUtilities', '1.2.0'
Fixed the problems I was having.
来源:https://stackoverflow.com/questions/36168692/google-signin-for-ios-fails-to-build-because-its-looking-for-a-file-that-doesn