Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'React/RCTBridgeModule.h' file not found #24017

Closed
Nabellaleen opened this issue Mar 18, 2019 · 3 comments
Closed

'React/RCTBridgeModule.h' file not found #24017

Nabellaleen opened this issue Mar 18, 2019 · 3 comments
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@Nabellaleen
Copy link

🐛 Bug Report

Not a breaking news : on iOS, my build failed because of React linking conflicts

Due to bugs "I don't know where" between React, React-Native and Cocoapods, I followed this article and link most of my dependencies via Podfile

It works well in Debug, but trying to build in Release, it fails with this tb :

.../node_modules/react-native/Libraries/Settings/RCTSettingsManager.h:10:9: fatal error: 'React/RCTBridgeModule.h' file not found
#import <React/RCTBridgeModule.h>

Notes:

  • I had to add manually and link all the "RCT*" React subspecs to make the build work on debug -- it seems they are not automatically linked as the normal pods are
  • I don't want a solution like "stop use cocoapod and link everything manual" : it should be a solution...
  • I've unchecked parallel builds
  • It fails with RN 0.58 and 0.59

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14.3
      CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
      Memory: 664.52 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.4.0 - ~/.nvm/versions/node/v8.4.0/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.9.0 - ~/.nvm/versions/node/v8.4.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.8.3 => 16.8.4 
      react-native: ^0.59.1 => 0.59.1 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Podfile:

target 'XXX' do
  platform :ios, '9.0'
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for XXX
  ## React
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
    # React subspecs should be linked manually, as cocoapod seems to not autolink its
    # How to ? See https://stackoverflow.com/a/46096893
    'RCTText',
    'RCTImage',
    'RCTNetwork',
    'RCTWebSocket',
    'RCTSettings',
    'RCTAnimation',
    'RCTLinkingIOS',
  ]
  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'

  ## Other dependencies
  pod 'AppCenterReactNativeShared', '~> 1.12.2'
  pod 'AppCenter/Crashes', '~> 1.13.2'
  pod 'AppCenter/Analytics', '~> 1.13.2'
  pod 'react-native-webview', :path => '../node_modules/react-native-webview'
  pod 'RNScreens', :path => '../node_modules/react-native-screens'
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

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

end

The exact error log :

Found Xcode workspace XXX.xcworkspace
Building using "xcodebuild -workspace XXX.xcworkspace -configuration Release -scheme XXX -destination id=ZZZ -derivedDataPath build"
User defaults from command line:

    IDEDerivedDataPathOverride = .../YYY/XXX/app/ios/build


note: Using new build system


note: Planning build

note: Using build description from disk

Build system information

warning: The iOS Simulator deployment target is set to 7.0, but the range of supported deployment target versions for this platform is 8.0 to 12.1. (in target 'RNGestureHandler')



Build system information

warning: The iOS Simulator deployment target is set to 7.0, but the range of supported deployment target versions for this platform is 8.0 to 12.1. (in target 'RNScreens')



CompileC .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/i386/RCTSettingsManager.o .../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: RCTSettings)
    cd .../YYY/XXX/app/node_modules/react-native/Libraries/Settings
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-cache-path=.../YYY/XXX/app/ios/build/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=.../YYY/XXX/app/ios/build/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wshadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/RCTSettings-generated-files.hmap -I.../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/RCTSettings-own-target-headers.hmap -I.../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/RCTSettings-all-target-headers.hmap -iquote .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/RCTSettings-project-headers.hmap -I.../YYY/XXX/app/ios/build/Build/Products/Release-iphonesimulator/include -I.../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/DerivedSources/i386 -I.../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/DerivedSources -Werror -Wall -F.../YYY/XXX/app/ios/build/Build/Products/Release-iphonesimulator -MMD -MT dependencies -MF .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/i386/RCTSettingsManager.d --serialize-diagnostics .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/i386/RCTSettingsManager.dia -c .../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.m -o .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/i386/RCTSettingsManager.o

In file included from 

.../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.m:8:
.../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.h:10:9: fatal error: 'React/RCTBridgeModule.h' file not found
#import <React/RCTBridgeModule.h>

        ^~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated

.


CompileC .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/x86_64/RCTSettingsManager.o .../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: RCTSettings)
    cd .../YYY/XXX/app/node_modules/react-native/Libraries/Settings
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-cache-path=.../YYY/XXX/app/ios/build/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=.../YYY/XXX/app/ios/build/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wshadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/RCTSettings-generated-files.hmap -I.../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/RCTSettings-own-target-headers.hmap -I.../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/RCTSettings-all-target-headers.hmap -iquote .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/RCTSettings-project-headers.hmap -I.../YYY/XXX/app/ios/build/Build/Products/Release-iphonesimulator/include -I.../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/DerivedSources/x86_64 -I.../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/DerivedSources -Werror -Wall -F.../YYY/XXX/app/ios/build/Build/Products/Release-iphonesimulator -MMD -MT dependencies -MF .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/x86_64/RCTSettingsManager.d --serialize-diagnostics .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/x86_64/RCTSettingsManager.dia -c .../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.m -o .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/x86_64/RCTSettingsManager.o

In file included from .../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.m:8:
.../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.h:10:9: fatal error: 'React/RCTBridgeModule.h' file not found
#import <React/RCTBridgeModule.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


** BUILD FAILED **



The following build commands failed:
	CompileC .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/i386/RCTSettingsManager.o .../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
	CompileC .../YYY/XXX/app/ios/build/Build/Intermediates.noindex/RCTSettings.build/Release-iphonesimulator/RCTSettings.build/Objects-normal/x86_64/RCTSettingsManager.o .../YYY/XXX/app/node_modules/react-native/Libraries/Settings/RCTSettingsManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

Installing build/Build/Products/Release-iphonesimulator/XXX.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Release-iphonesimulator/XXX.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist


Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Release-iphonesimulator/XXX.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:591:13)
    at Object.execFileSync (child_process.js:611:13)
    at Promise.then (.../YYY/XXX/app/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
    at <anonymous>
@kelset
Copy link
Contributor

kelset commented Mar 20, 2019

Hello there 👋 this issue doesn't have a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting). Unfortunately, I have no way of helping you in a meaningful way – there is no easy way for me to recreate the situation and check that the issue reported is still there when changing the code; also, it looks like it's related to something in your XCode config.

Because of this, we are going to close this issue - but if a repro is shared, we are happy to reopen it 🤗

@AndreiCalazans
Copy link
Contributor

@Nabellaleen did you try this solution: #24363 (comment) ?

I had just updated my mac to Mojave and I started getting this. Give it a try. Make sure you close your xcode first before running the command.

@sultan-arshi
Copy link

+1

@facebook facebook locked as resolved and limited conversation to collaborators Mar 20, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants