React NativeでのXcodeBuild時のduplicateエラーの解消方法

#概要
普段はReact NativeでiOSアプリを開発してます
今回は、[react-native-google-maps](https://github.com/react-native-community/react-native-maps)などの導入により、ReactやYogaなどをpod installした際Xcodeでbuildするとduplicateエラーが出る問題を解決するメモを共有します


```

platform :ios, '9.0'
target 'Your App Name' do
 pod 'Yoga', :path => '../node_modules/react- native/ReactCommon/yoga'

 pod "React", :path =>  '../node_modules/react-native', :subspecs => [
     "Core",
      "ART",
      "RCTActionSheet",
      "RCTAnimation",
      "RCTCameraRoll",
      "RCTGeolocation",
      "RCTImage",
      "RCTNetwork",
      "RCTText",
      "RCTVibration",
      "RCTWebSocket",
      "DevSupport",
      "BatchedBridge"
  ]

  pod 'GoogleMaps'
  pod 'react-native-maps', path: '../node_modules/react-native-maps' 
  pod 'react-native-google-maps', path: '../node_modules/react-native-maps' 

end


post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "react-native-google-maps"
      target.build_configurations.each do |config|
        config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
      end
    end
  end
end
```

上記のようなpodfileでpod installをすると下記のようなエラーが出ます


```
ld: warning: directory not found for option '-L/Directory/Your/App/name'
duplicate symbol _OBJC_CLASS_$_RCTVibration in:
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTVibration.o)
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libRCTVibration.a(RCTVibration.o)
duplicate symbol _OBJC_METACLASS_$_RCTVibration in:
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTVibration.o)
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libRCTVibration.a(RCTVibration.o)
duplicate symbol _OBJC_CLASS_$_RCTFrameAnimation in:
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTFrameAnimation.o)
~~~中略~~~
duplicate symbol _OBJC_METACLASS_$_RCTWebSocketModule in:
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
duplicate symbol _OBJC_CLASS_$_PodsDummy_Yoga in:
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libYoga.a(Yoga-dummy.o)
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libyoga.a(Yoga-dummy.o)
duplicate symbol _OBJC_METACLASS_$_PodsDummy_Yoga in:
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libYoga.a(Yoga-dummy.o)
    /Directory/Your/App/NameBuild/Intermediates.noindex/ArchiveIntermediates/yourappname/BuildProductsPath/Release-iphoneos/libyoga.a(Yoga-dummy.o)
ld: 421 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

```
#解決
pod install時にReactとYogaがpodでインストールされてしまっているので、workspaceから開いてpodプロジェクトを選択する
<img width="579" alt="スクリーンショット 2019-10-29 18.24.28.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/99502/6cccc572-2016-34b8-362d-a5be4a7e390f.png">
ReactとYogaがあるので
下画像のようにReactとYogaをTargetから取り除く
<img width="668" alt="スクリーンショット 2019-10-29 18.16.58.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/99502/063b5aee-66cf-37e4-db21-432f8367bf7f.png">



これでduplicateが出なくなるのでbuildが正常に行えるようになります