3

Disclaimer - I'm inexperienced with Xcode / iOS development. At this point, I keep Googling, but I'm just attempting random fixes that I don't understand. I can move forward with the app on Android, but iOS support is a requirement for the users.

Current build errors:

Multiple targets match implicit dependency for product reference 'libReactNativeNavigation.a'. 
Consider adding an explicit dependency on the intended target to resolve this ambiguity.
(in target 'AwesomeProject' from project 'AwesomeProject')

Multiple targets match implicit dependency for linker flag '-lReactNativeNavigation'. 
consider adding an explicit dependency on the intended target to resolve this ambiguity.
(in target 'AwesomeProject' from project 'AwesomeProject')

Background

This is a React Native mobile app that's been working fine for the last few months, up until two weeks ago when I had other important work to switch my efforts toward. I quit/closed Xcode two weeks ago and reopened a few days ago to pick back up, but I got an error like

no podspec found in node_modules (I don't remember the exact problem)

In attempting to fix it, I deintegrated/cleaned/modified/reinstalled pod as detailed here.

Then somehow I got this error:

React/RCTEventEmitter.h file not found
(+ a 2nd similar message for another file)

Today, I've tried 1. cleaning DerivedData a. moving it relative to my Xcode project, 2. Setting Build Active Architecture Only to No, 3. Step 5: If Xcode complains when linking... (except I don't think it was a *.a static library I added?

Now, the build fails after a few seconds:

Multiple targets match implicit dependency for product reference 'libReactNativeNavigation.a'. 
Consider adding an explicit dependency on the intended target to resolve this ambiguity.
(in target 'AwesomeProject' from project 'AwesomeProject')

Multiple targets match implicit dependency for linker flag '-lReactNativeNavigation'. 
consider adding an explicit dependency on the intended target to resolve this ambiguity.
(in target 'AwesomeProject' from project 'AwesomeProject')

I think the Podfile is straightforward?

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'AwesomeProject' do
  # Pods for AwesomeProject
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'

  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'

  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  pod 'react-native-camera', :path => '../node_modules/react-native-camera'

  pod 'react-native-cameraroll', :path => '../node_modules/@react-native-community/cameraroll'

  pod 'react-native-orientation-locker', :path => '../node_modules/react-native-orientation-locker'

  target 'AwesomeProjectTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'AwesomeProject-tvOS' do
  # Pods for AwesomeProject-tvOS

  target 'AwesomeProject-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end
sandpat
  • 1,478
  • 12
  • 30
Dan Bitter
  • 229
  • 4
  • 12

2 Answers2

2

This is just a warning i believe, got one in my project too. I was linking manually library, done all the steps and my project failed to build. Since there was no error i thought the reason why it won't work must be in this warning, but i was mistaken. If you can, go back to error "React/RCTEventEmitter.h file not found" as this is something resolvable. React/RCTEventEmitter.h file not found @chitzui answer helped me resolve my problem

Chamel
  • 66
  • 4
1

It happens to me when I'm adding subspecs too. It's not possible for me to change this setup, but in your case, does ReactNative support a All subspec? Sorry I don't know much about this framework as I've been intentionally staying away from it for years; hope some ReactNative experts can help.

superarts.org
  • 7,009
  • 1
  • 58
  • 44