+-
多个目标匹配产品引用/链接器标记的隐式依赖项

免责声明-我对Xcode / iOS开发缺乏经验。在这一点上,我继续使用Google搜索,但是我只是在尝试一些我不了解的随机修复程序。我可以在Android上继续使用该应用程序,但用户需要iOS支持。

当前构建错误:

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')

背景

这是一个React Native移动应用程序,在过去的几个月中一直运行良好,直到两周前,当我进行其他重要工作以转向我的工作时。我两周前退出/关闭了Xcode,几天前重新打开以进行备份,但是出现类似[]的错误

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

[尝试修复它时,我deintegrated/cleaned/modified/reinstalled pod as detailed here。

然后以某种方式出现此错误:

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

今天,我已经尝试过1.清理DerivedData一个。相对于我的Xcode项目移动它,2.将Build Active Architecture Only设置为No,3. Step 5: If Xcode complains when linking... (except I don't think it was a *.a static library I added?

现在,构建会在几秒钟后失败:

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')

我认为Podfile很简单?

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

免责声明-我对Xcode / iOS开发缺乏经验。在这一点上,我会继续使用Google搜索,但是我只是在尝试一些我不了解的随机修复程序。我可以继续使用Android上的应用,...

0
投票

当我也添加子规格时,也会发生这种情况。我无法更改此设置,但是在您的情况下,ReactNative是否支持All子规格?抱歉,我对该框架了解不多,因为我多年来一直故意远离它。希望一些ReactNative专家可以提供帮助。