title: Error configuring Google analytics for iOS app with GoogleService-Info.plist
body: <p>I followed this <a href="https://developers.google.com/analytics/devguides/collection/ios/v3/" rel="noreferrer">Google developer guide</a> to add Google analytics to an iOS app using Cocoa Pods. I added the <code>GoogleService-Info.plist</code> and put the initialisation code in <code>didFinishLaunchingWithOptions</code>. The app builds fine, but then crashes at the point it tries to initialise GA. Specifically these lines of code:</p>
  
  <pre><code>NSError *configureError;
  [[GGLContext sharedInstance] configureWithError:&amp;configureError];
  NSAssert(!configureError, @"Error configuring Google services: %@", configureError);
  </code></pre>
  
  <p>The assert statement is failing and the output in the console is:</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
  reason: 'Error configuring Google services: 
  Error Domain=com.google.greenhouse Code=-200 "Unable to configure GGL."
  {NSLocalizedFailureReason=Unable to parse supplied GoogleService-Info.plist. See log for details., 
  NSLocalizedRecoverySuggestion=Check formatting and location of GoogleService-Info.plist., 
  NSLocalizedDescription=Unable to configure GGL.}'
  </code></pre>
  
  <p>I can see this is due to the <code>GoogleService-Info.plist</code> file and after some investigation I found that even if I delete <code>GoogleService-Info.plist</code> I get the error, which leads me to believe that I had not added the file to the project correctly. </p>
  
  <p>Here is a screenshot of what I checked when adding the file:</p>
  
  <p><img src="https://i.stack.imgur.com/6Nau4.png" alt="enter image description here"></p>
  
  <p>So I have made sure that it is added to all targets and that the file is in the root directory of the project, alongside the <code>xcodeproj</code> and <code>xcworkspace</code> files, as per the instructions on the Google developer guide.</p>
  
  <p>I should also mention that this is a SpriteBuilder project, but I don't think that has anything to do with this. Also this was the first Cocoa Pod that I added, but all seems fine with that as the project builds and can find all the Google headers it needs.</p>