Nat
Nat

Reputation: 12948

Cocoapods duplicate symbol - Google APIs

I've performed pod update 2 days ago, everything went with success, I could build the project. Log:

Removing DTAlertView
Downloading dependencies
Using GTMHTTPFetcher (0.1.0)
Using Google-API-Client (0.1.1)
Using Google-Maps-iOS-SDK (1.9.0)
Using KissXML (5.0)
Using MGSwipeTableCell (1.3.3)
Installing RNBlurModalView (0.1.0)
Using gtm-oauth2 (0.1.0)
Using iVersion (1.11.4)
Using libextobjc (0.4.1)
Generating Pods project
Integrating client project

Now I had to perform pod update again, however now I can't build the project. Log:

Removing RNBlurModalView
Downloading dependencies
Installing GTMHTTPFetcher 1.141 (was 0.1.0)
Using Google-API-Client (0.1.1)
Installing Google-Maps-iOS-SDK 1.9.1 (was 1.9.0)
Using KissXML (5.0)
Installing MGSwipeTableCell 1.3.5 (was 1.3.3)
Installing gtm-http-fetcher (1.0.141)
Installing gtm-oauth2 1.0.125 (was 0.1.0)
Using iVersion (1.11.4)
Using libextobjc (0.4.1)
Generating Pods project
Integrating client project

[!] GTMHTTPFetcher has been deprecated in favor of gtm-http-fetcher

I need to complete one feature today and my project doesn't build. What to do to at least enable it to build? pod install doesn't help. I've noticed that probably version jump of Google-Maps-iOS-SDK made the whole mess with GTMHTTPFetcher, so I've tried to set in podfile version 1.9.0:

inhibit_all_warnings!

pod 'libextobjc', '~> 0.4'
pod 'KissXML', '~> 5.0'
pod 'Google-Maps-iOS-SDK', '1.9.0'
pod 'Google-API-Client', '~> 0.1'
pod 'MGSwipeTableCell', '~> 1.0'
pod 'iVersion', '~> 1.10'

But it doesn't help. Probably Google-api-client is incompatible with Google maps, because if I remove google api:

Removing GTMHTTPFetcher
Removing Google-API-Client
Removing gtm-http-fetcher
Removing gtm-oauth2
Downloading dependencies
Installing Google-Maps-iOS-SDK (1.9.1)
Using KissXML (5.0)
Using MGSwipeTableCell (1.3.5)
Using iVersion (1.11.4)
Using libextobjc (0.4.1)
Generating Pods project
Integrating client project

And probably it would work (can't try, many connections from the code). The errors:

[... many more of same type as below ...]
duplicate symbol _OBJC_METACLASS_$_GTMReadMonitorInputStream in:
    /Users/username/Library/Developer/Xcode/DerivedData/project-cvbrvhbcpumxaohhjabqvxiyzotr/Build/Products/Debug-iphoneos/libPods-GTMHTTPFetcher.a(GTMReadMonitorInputStream.o)
    /Users/username/Library/Developer/Xcode/DerivedData/project-cvbrvhbcpumxaohhjabqvxiyzotr/Build/Products/Debug-iphoneos/libPods-gtm-http-fetcher.a(GTMReadMonitorInputStream.o)
ld: 163 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Neither clean nor deleting derived data doesn't help.

Upvotes: 1

Views: 1814

Answers (3)

Nat
Nat

Reputation: 12948

I'm posting this as an updated answer.

From post of @peter-segerblom, I've noticed that in fact GTMHTTPFetcher is an older version of gtm-http-fetcher. Because of compability issues, I couldn't update Google-API-Client. Temporary workaround was to:

  1. Open ~/.cocoapods/repos
  2. Delete gtm-oauth2 (>= 1.0.125)
  3. Delete gtm-http-fetcher (whole)
  4. Delete GTMHTTPFetcher (> 0.1.0)

However atm, all of us need to update the libraries to use bitcode, as the project won't even build in the new Xcode. Because of this, I've updated my code and changed version from:

pod 'Google-API-Client', '~> 0.1'

to:

pod 'Google-API-Client', '~> 1.0'

Now only waiting for Google to update the lib to bitcode requirements, as with new Google-API-Client everything is working properly and we don't need to do these hacks with deleting from .cocoapods/repos.

Upvotes: 0

Binh Le
Binh Le

Reputation: 363

I met this case and already resolved it. Open two configuraton files of Pod
Pods-your_app_name.debug.xcconfig
Pods-your_app_name.release.xcconfig
then removing anything which is related to "GTMHTTPFetcher". Clean and build again. It will work fine.
This solution is not best solution so far. Because everytime you run command "pod install", GTMHTTPFetcher will be installed automatically and you (include me) have to follow steps above to remove again. Anyway here is unique solution for me until now.

Upvotes: 2

Peter Segerblom
Peter Segerblom

Reputation: 2823

These two look too be the same thing?

Installing gtm-http-fetcher (1.0.141)
Installing GTMHTTPFetcher 1.141 (was 0.1.0)

And since the error is duplicate symbols in the linker I would try removing one of them.

Upvotes: 0

Related Questions