1

I encountered a very strange thing. I used the cocoapods-packager to generate two frameworks, each of which depends on an identical third-party library. When I run two frameworks into my project, there is absolutely no problem. However, when I use cocoapods to integrate these two frameworks, xcode always prompts "duplicate symbol _OBJC_CLASS_$_

  1. PodsDummy_Pods_packager

".It means Pods-packager-dummy.o is repeated.

How can I solve this problem?

Shivam Tripathi
  • 1,405
  • 3
  • 19
  • 37
Arthur Liu
  • 21
  • 2

1 Answers1

1

I implemented the references of these two frameworks with 'subspec'. In the podspec file, I originally wrote 's.dependency' on top of 's.subspec', so when using cocoapods, an error occurs.

So, I wrote 's.dependency' in every 's.subspec' and the problem was solved.

Correct writing is like this:

  s.subspec 'XXXX' do |ss| 
    ss.vendored_frameworks = '**/XXXX.framework'
    ss.dependency 'xxx'
  end
Arthur Liu
  • 21
  • 2