IMACODE
IMACODE

Reputation: 130

Duplicate symbol iOS with Cocoapods

I have an issue when I want compile my app

duplicate symbol _OBJC_METACLASS_$_PodsDummy_Pods_silkke in:
/Users/peltie_j/Library/Developer/Xcode/DerivedData/silkke-gubgeyzrbcwqglexienpzvasdvwk/Build/Products/Debug-iphoneos/libPods-Silkke.a(Pods-silkke-dummy.o)
/Users/peltie_j/Library/Developer/Xcode/DerivedData/silkke-gubgeyzrbcwqglexienpzvasdvwk/Build/Products/Debug-iphoneos/libPods-silkke.a(Pods-silkke-dummy.o)

duplicate symbol _OBJC_CLASS_$_PodsDummy_Pods_silkke in:
/Users/peltie_j/Library/Developer/Xcode/DerivedData/silkke-gubgeyzrbcwqglexienpzvasdvwk/Build/Products/Debug-iphoneos/libPods-Silkke.a(Pods-silkke-dummy.o)
/Users/peltie_j/Library/Developer/Xcode/DerivedData/silkke-gubgeyzrbcwqglexienpzvasdvwk/Build/Products/Debug-iphoneos/libPods-silkke.a(Pods-silkke-dummy.o)

ld: 2 duplicate symbols for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I don't understand why, so if you have any idea, thanks by advance !

Upvotes: 0

Views: 3627

Answers (2)

veducm
veducm

Reputation: 5953

This basically means that you have PodsDummy_Pods_silkke added as a dependency twice in your build, so it builds two binaries for it (libPods-Silkke.a). It could be because of any of the following:

  • A mistake on your podfile (eg. you include the same pod in the main target and the test one).
  • You added the dependency both as a pod and manually (eg. if you used to have the library imported as code in your project and now you are moving to Cocoapods, but you forgot to remove the copy imported manually).
  • Something else really bad happened, which probably requires that you clean your pods folder, reinstall them (pod install), reopen your Xcode workspace, clean the build from Xcode (Cmd + K) and try to build again.

Upvotes: 3

Samir
Samir

Reputation: 892

This generally happens when you have added reference of same file/s multiple times in project. I suggest to search the file "PodsDummy_Pods" in Show and Find Navigator and remove reference if its added twice.

Upvotes: 0

Related Questions