14

I am trying to use Google Analytics into my App.

But immediately after adding it via CocoaPod i am getting this Error:

enter image description here

Previously I have GoogleMaps and GCM in my pod.

Now My Pod is look like this:

platform :ios, '8.0'

pod 'Google/Analytics'
pod 'Google/CloudMessaging'
pod 'GoogleMaps'

How Can I resolve this Error:

*EDIT

This solve my problem:

If I run my existing project X-Code 7 then I am not getting the Error.

But I want it to run in Xcode 6.4 so I added older version of GA and that works fine with X-Code 6.4.

I have added manually the older sdk but if any one wants to add it Via Cocoa-Pod then Here is the way of doing it:

  pod 'Google/Analytics'
  pod 'GoogleAnalytics', '3.13.0'
Rahul
  • 5,594
  • 7
  • 38
  • 92

3 Answers3

3

Please remove "Other linker flag" which is set in build setting. If it is set to -ObjC then please remove it and try to build again.

hope this works

Anil solanki
  • 962
  • 4
  • 20
2

This happened to me couple of times. To solve it run this two commands after adding your pods to the Podfile:

pod deintegrate

pod clean

Then:

pod install

If you find duplicated files xxxxxx 2.xx, in you Pod/ folder, try to move your project outside of Documents or Desktop, iCloud likes to mess the things if you work from different machines.

JFCa
  • 79
  • 1
  • 6
  • 1
    Thanks. This happened to me too. How often you got such error? – Aji Saputra Raka Siwi Nov 09 '21 at 12:16
  • I solved this issue storing the projects outside of the "clouded" folders, like desktop or documents, due I work in two different macs with the same apple id, this thing was messing my work. – JFCa Nov 10 '21 at 13:34
  • 1
    Thank you sir, worked perfectly. I use iCloud between machines and ran into this problem. Running `pod deintegrate` and then `pod install` worked for me. There is no `pod clean` command in my current version but seems it was not needed. – James DeCarlo Feb 19 '22 at 15:49
0

This error often happens is accidentally importing the .m file instead of the .h

Jiri Zachar
  • 487
  • 3
  • 8
  • 2
    I am not importing any file..I just run `pod install` and build then I got this error – Rahul Dec 04 '15 at 09:26