I follow this manual(https://developers.google.com/analytics/devguides/collection/ios/v3/?ver=swift#get-config) to integrate Google analytics in my app. But i getting some error when i try to test it!
ld: framework not found GoogleInterchangeUtilities
I have already made this:
1)in podfile:
pod 'Google/Analytics' -> pod install
2) in APP-Bridging-Header.h:
#import "Google/Analytics.h"
#import "GAI.h"
#import "GAIDictionaryBuilder.h"
#import "GAIEcommerceFields.h"
#import "GAIEcommerceProduct.h"
#import "GAIEcommerceProductAction.h"
#import "GAIEcommercePromotion.h"
#import "GAIFields.h"
#import "GAILogger.h"
#import "GAITrackedViewController.h"
#import "GAITracker.h"
3) GoogleService-Info.plist already added to my project. But i don't understand what google mean say: "Add GoogleService-Info.plist to each target!!!"
I try add a GoogleInterchangeUtilities framework to "Link Binary With Libraries" and "Copy Frameworks" but it did not help!
Help me please!
I ran into a similar problem a couple of days ago. You should follow these steps.
- Install Cocoapods
- In Terminal, navigate to the directory which has your Xcode Project in it.
- Type
pod init
- Then type
pod install
(I know this sounds early but I will explain)
- Open the workspace file and find the podfile that was created by Cocoapods. Edit that file to include
pod 'Google/Analytics'
- Go back to terminal and type
pod install
again. I could get not get Cocoapods to work with the podfile I created, so had to use the one they created.
- Now, upon install, you should see that items have been downloaded.
- Go back into the workspace file, and set up your
-Bridging-Header.h
- Type this into the
-Bridging-Header.h
#import "Google/Analytics.h"
- If for some reason that doesn't work (it didn't for me), the type each individual item.
- Be sure to add the correct directory for your -Bridging-Header.h. You can find this under Project - Build Settings - Swift Compiler Code Generation. Use this to easily target your header file $(SWIFT_MODULE_NAME)-Bridging-Header.h
- Drag the
.plist
file into Xcode and select all of the targets, as seen in the below picture.
You will know that everything has installed correctly when you look into the Navigator in Xcode and see a PODS folder with a bunch of Google stuff in it. It should look like this in the navigator.
That should have you squared away. I ran into many issues very similar to yours. Let me know if you need clarification on something.