React/RCTEventEmitter.h file not found

后端 未结 8 1550
梦谈多话
梦谈多话 2021-02-04 02:56

I am trying to implement PushNotificationIOS with a detached Expo app. I am running SDK 21.0.0 (React Native 0.48).

I am getting React/RCTEventEmitter file not fou

8条回答
  •  眼角桃花
    2021-02-04 03:01

    Since nothing mentioned above worked for me, I started experimenting, and this is what solved it for me:

    1. Link React-Core & Public

    As mentioned by Escamilla, in xcode open the RCTPushNotification.xcodeproj and under Build Settings search for header search path and add there the 2 path:

    • "$(SRCROOT)/../../../../ios/Pods/Headers/Public"
    • "$(SRCROOT)/../../../../ios/Pods/Headers/Public/React-Core"

    2. Copy RCTPushNotificationManager.h manually into React-Core

    In the root folder of your project execute:

    cp ./node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h ./ios/Pods/Headers/Public/React-Core/React
    

    This will copy RCTPushNotificationManager.h wich is in node_modules/react-native/Libraries/PushNotificationIOS/ manually into the React folder which is in ios/Pods/Headers/Public/React-Core/React.


    I have no idea if that is a good solution but it works. Maybe if someone could explain me why it was not in there in the first place? That would be golden.

    I followed the setup instructions 1 by 1 very carefully doing everything right but nothing worked except the manual copy mentioned above…

    Also, this is randomly resetted once in a while and has to be done again -.-'

提交回复
热议问题