GTMAppAuth & GTLRCore -> 2 SessionFetchers

131 views
Skip to first unread message

Steve Cronin

unread,
Aug 11, 2019, 7:19:44 PM8/11/19
to Google APIs Client Library for Objective-C

I want to use GTMAppAuth as the authorizing tool for working with GTLRCore.
I have successfully implemented this setup but I am troubled the duplication of SessionFetcher.

I'm using CocoaPods for GTMAppAuth (pod 'GTMAppAuth').
I have cloned 'google-api-objectivec-client-for-rest' which allows me to build a 'GTLROSXCore' framework in order to utilize the Google Rest client. This project is included in my Xcode workspace.

Both of these Google tools include SessionFetcher.

When I run my macOS app, immediately there are 7 messages in the log (one for each of the 7 classes which constitute 'SessionFetcher' e.g.
objc[30607]: Class GTMGatherInputStream is implemented in both /Users/steve/Library/Developer/Xcode/DerivedData/.../GTLR.framework/Versions/A/GTLR (0x100c2ed10) and /Users/steve/Library/Developer/Xcode/DerivedData/.../Frameworks/GTMSessionFetcher.framework/Versions/A/GTMSessionFetcher (0x1007f96e0). One of the two will be used. Which one is undefined.

Can someone suggest a means by which I might have only 1 instance of SessionFetcher and avoid this troubling situation?

Thomas Van Lenten

unread,
Aug 12, 2019, 10:44:45 AM8/12/19
to Google APIs Client Library for Objective-C
Sounds like you are still mixing packaging systems, GTLR bundles SessionFetcher if you use ti directly, but if you use CocoaPods, it would let CocoaPods provide it.  You are then using CocoaPods for GTMAppAuth, so it is providing the dependency.  If you are using CocoaPods, just use that for everything and the it will manage dependencies.  Otherwise, don't use the Xcode project GTLR provides so you don't get the SessionFetcher there also.

TVL

Steve Cronin

unread,
Aug 12, 2019, 2:32:38 PM8/12/19
to Google APIs Client Library for Objective-C
Thomas;

Thanks for the quick response!
Your consul to not include the Xcode means I must adapt my current 'Podfile'  to now include 'GoogleAPIClientForREST'
When I look at the podspec file provided I do not understand how to add 'GoogleAPIClientForREST' while retaining the dependency spec for SessionFetcher and a subspec for PeopleService

Current Podfile:
target 'XYZ' do
  platform :osx, '10.12'

  pod 'GTMAppAuth'
  pod 'ABC', '~> 46.0.0'
  pod 'CDE', '~> 0.5.0'
end
 
Simply adding the line:
pod  'GoogleAPIClientForREST'', '~> 1.3.9'.   is clearly not sufficient.

Can you share any guidance on how to modify this existing Podfile?

Thomas Van Lenten

unread,
Aug 12, 2019, 3:04:24 PM8/12/19
to Google APIs Client Library for Objective-C
GoogleAPIClientForREST just gets you the default subspec (Core), depend on the subspec(s) for the service(s) you want: GoogleAPIClientForREST/PeopleService
Reply all
Reply to author
Forward
0 new messages