2
duplicate symbol _OBJC_METACLASS_$_GTMOAuth2Keychain in:
    /Users/anand/Library/Developer/Xcode/DerivedData/NIDA_Rooms-bawdeawpyzqrkjazbcspzbsqgrht/Build/Products/Release-iphoneos/GTMOAuth2/libGTMOAuth2.a(GTMOAuth2ViewControllerTouch.o)
    /Users/anand/Documents/Anand_ios_Project/ROC&NIDAROOMS/ROCAPP 3/GoogleOpenSource.framework/GoogleOpenSource(GTMOAuth2ViewControllerTouch.o)
ld: 112 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sangu
  • 51
  • 1
  • 7

2 Answers2

1

You link against GoogleOpenSource.framework and libGTMOAuth2.a. Both contain (define) the symbol _OBJC_METACLASS_$_GTMOAuth2Keychain. You should remove either the framework or the lib from linking.

clemens
  • 16,716
  • 11
  • 50
  • 65
  • How to fix it? cause I'm using this framework so cant delete. – Sangu Nov 18 '16 at 06:51
  • Try to remove the library from the target settings of your project. The duplicate symbols errors should disappear, but missing symbols could appear. If that happen, add the library again and remove the framework. You cannot build your app with both, library and framework. – clemens Nov 18 '16 at 06:55
  • please nevgate how to do this in project – Sangu Nov 18 '16 at 07:06
  • Look into the **target settings** of your app. There's a tab _General_ where you can find a section `Linked Frameworks and Libraries`. Select the framework and click the minus symbol below. – clemens Nov 18 '16 at 07:10
0

This might happen when an implementation is defined in the .h file.

Particularly in this case have a look at where does GTMOAuth2Keychain is define, and if it's in GTMOAuth2ViewControllerTouch.h.

Fix it by moving the implementation to the .mm/.m file.

danielhadar
  • 2,031
  • 1
  • 16
  • 27