“RCTBundleURLProvider.h” file not found - AppDelegate.m

后端 未结 26 1346
遇见更好的自我
遇见更好的自我 2020-12-04 06:29

I am trying to run my React Native app in XCode and I keep getting this error. I cannot figure out how to resolve the issue. Any suggestions?

Screen Shot of Error in

相关标签:
26条回答
  • 2020-12-04 07:08

    https://github.com/facebook/react-native/blob/v0.63.3/template/ios/Podfile

    Find/Replace HelloWorld with your your project name.

    Place this file into the ./ios folder in your project

    gem install cocoapods
    cd ios
    pod install
    

    Then open the YourProject.xcworkspace file in XCode

    in XCode, go to Product -> Scheme -> Manage Schemes and check React

    Then try building the project again.

    0 讨论(0)
  • 2020-12-04 07:09

    For my case in ReactNative "0.54.2", i solved it with following solution

    In Xcode select Product->Scheme->Manage Schemes, untick 'YourProject'-tvOS set it to not Shared

    0 讨论(0)
  • 2020-12-04 07:10

    I am using React Native 0.61. I created a Share Extension and was getting this error. I needed to replace:

    #import "RCTBundleURLProvider.h"
    

    with

    #import "React/RCTBundleURLProvider.h"
    
    0 讨论(0)
  • 2020-12-04 07:12

    For me replacing

    #import <React/RCTBundleURLProvider.h>
    #import <React/RCTRootView.h>
    

    by

    #import <RCTBundleURLProvider.h>
    #import <RCTRootView.h>
    

    in AppDelegate.m file worked.

    0 讨论(0)
  • 2020-12-04 07:12

    I have gone through all the answers mentioned above.

    Here is the solution worked for me:

    STEP 1:

    Run:

    npm install react-native-fcm --save 
    

    This result in making the directory in your project under node_modules > react-native-fcm

    STEP 2:

    You need to add '$(SRCROOT)/../node_modules/react-native-fcm/ios' to header search paths in build settings.

    These 2 steps worked for me to remove the error.

    For more details you can go through these links:

    https://github.com/evollu/react-native-fcm/issues/63

    https://github.com/evollu/react-native-fcm/issues/21

    0 讨论(0)
  • 2020-12-04 07:13

    For all those are using React Native 0.40.0 or higher, Header Imports have a major change from RN 0.40.0 and result in lots of .h file not found errors. react-native-git-upgrade fixed the issue for me while in debug but build fails in release/archive.

    I am using RN 0.42.3 with cocoapods and Xcode 8.2.1

    To completely fix this go to Xcode>Product>Scheme>Edit Scheme>

    1. Untick Parallelize Build
    2. Click on + button in Targets and add React
    3. Drag the added React to top of the List in Targets.

    Now clean the project and build

    0 讨论(0)
提交回复
热议问题