Antoine Auffray
Antoine Auffray

Reputation: 1293

React Native iOS pod setup has duplicate target issue

I'm building an app with React Native and I have to add pod dependencies to my project. I followed a tutorial on how to init a pod with a brand new react-native init project. This is the content of my Podfile:

target 'MyProject' do

  target 'MyProject-tvOSTests' do
    inherit! :search_paths
  end

  target 'MyProjectTests' do
    inherit! :search_paths
  end

end

target 'MyProject-tvOS' do

  target 'MyProject-tvOSTests' do
    inherit! :search_paths
  end

end

Then I run pod install, and I get this error:

The target MyProject-tvOSTests is declared twice.

I think it's an issue with the react-native init but I don't know how to correct it.

Thanks in advance!

Upvotes: 8

Views: 5075

Answers (1)

user3151675
user3151675

Reputation: 58019

Your MyProject-tvOSTests target is duplicated. Remove the first instance of it.

target 'MyProject' do

  target 'MyProjectTests' do
    inherit! :search_paths
  end

end

target 'MyProject-tvOS' do

  target 'MyProject-tvOSTests' do
    inherit! :search_paths
  end

end

Upvotes: 15

Related Questions