Pod 1.1.4 - "GTMOAuth2ErrorTokenUnavailable" Naming error
mikezucc opened this issue · 10 comments
for pod 1.1.4, GTMOAuth2ErrorTokenUnavailable
is used instead of kGTMOAuth2ErrorTokenUnavailable
. Anyone else get this build error? Something seems off with the pod, because if I manually resolve this a linker error shows up later on for a misnamed selector
The constant doesn't have a k on the front: https://github.com/google/gtm-oauth2/blob/master/Source/GTMOAuth2Authentication.h#L102.
The one with the k is a #define
- https://github.com/google/gtm-oauth2/blob/master/Source/GTMOAuth2Authentication.h#L110
The build fails in this function:
+ (BOOL)saveParamsToKeychainForName:(NSString *)keychainItemName
accessibility:(CFTypeRef)accessibility
authentication:(GTMOAuth2Authentication *)auth
error:(NSError **)error
[self removeAuthFromKeychainForName:keychainItemName];
// don't save unless we have a token that can really authorize requests
if (![auth canAuthorize]) {
if (error) {
*error = [NSError errorWithDomain:kGTMOAuth2ErrorDomain
code:GTMOAuth2ErrorTokenUnavailable
userInfo:nil];
}
return NO;
}
if (accessibility == NULL) {
accessibility = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly;
}
// make a response string containing the values we want to save
NSString *password = [auth persistenceResponseString];
GTMOAuth2Keychain *keychain = [GTMOAuth2Keychain defaultKeychain];
return [keychain setPassword:password
forService:keychainItemName
accessibility:accessibility
account:kGTMOAuth2AccountName
error:error];
}
Exact error: Use of undeclared identifier GTMOAuth2ErrorTokenUnavailable
Also, my version of that header is
enum {
// Error code indicating that the window was prematurely closed
kGTMOAuth2ErrorWindowClosed = -1000,
kGTMOAuth2ErrorAuthorizationFailed = -1001,
kGTMOAuth2ErrorTokenExpired = -1002,
kGTMOAuth2ErrorTokenUnavailable = -1003,
kGTMOAuth2ErrorUnauthorizableRequest = -1004
};
Ah it seems that a pod is using GTM 1.0, not 1.1.4. I'm guessing the version of the header is 1.0
Sounds like something is causing a mix of versions then? You'll probably want to reach out to them about the making sure they can use 1.1.x also.
Yep I'll send an email to Google. thanks for quick response 👍
You can close this as not an issue
Actually, are they shipping copies of these headers? Maybe that's where the mixup comes, you get one dep on this pod which is 1.1.x, and they ship a copy of the older headers and the header search path decides what gets found.
Actually, I was doubly wrong, we had a lingering dependency from the original google plus ios sdk days where they shipped with copies of the old frameworks. false alarm :]