React-native-code-push: 1.15.0 on ios using swift and cocoapods - RCTEventEmitter not found

Created on 26 Oct 2016  Â·  29Comments  Â·  Source: microsoft/react-native-code-push

  • react-native-code-push version: 1.15.0-beta
  • react-native version: 0.34.0
  • iOS/Android/Windows version: ios
  • Does this reproduce on a debug build or release build? na
  • Does this reproduce on a simulator, or only on a physical device? na
  • Repro steps and/or stack trace:

ios project using cocoapods and swift, code-push 1.14.6-beta - no issues.
upgrade to 1.15.0-beta
pod install
build project - node_modules/react-native-code-push/ios/CodePush/CodePush.h:1:9: 'RCTEventEmitter.h' file not found

change line 1 of CodePush.h to #import "React/RCTEventEmitter.h"
build succeeds

A while back react-native had issues with cocoapods see https://github.com/facebook/react-native/issues/9014 as an example, it may help.

investigating

Most helpful comment

I'm still facing this issue

"react-native": "0.50.4",
"react-native-code-push": "^5.2.1",

All 29 comments

@silhouettes have you guys made any progress on this? Can I help in anyway?

I am having the same issue using RNPM with versions:

    "react-native": "0.35.0",
    "react-native-code-push": "^1.15.0-beta",

and Xcode 7.3.1 for my iOS project: https://github.com/Laybium/laybium

When I tried change line 1 of CodePush.h to #import "React/RCTEventEmitter.h"
I still get the same error.

@silhouettes Is there a earlier version of react-native-code-push I should try? Thanks

UPDATE: @stewart42
I deleted the entire node_modules folder, shut down all processes, then npm install, cmd+shift + k to clean the build, cmd + shift+b to create the build, and then cmd + r to run the app again. This time my app loaded :)

I think for the future every time you add a new package through npm you always need to delete node_modules and re npm install

@quinnliu you could try v1.14.6-beta

@stewart42, sorry about the slow response. Does @quinnliu's fix work for you by any chance?

@silhouettes I had the same issue as @stewart42 and I followed the work around as mentioned by @quinnliu . It unfortunately didnt work for me. I still get the error "RCTEventEmitter.h" file not found. For me "React/RCTEventEmitter.h" also didnt work. I am trying to setup CodePush for an iMessage Extension using React native. My react native version is 0.34.0 and code push version is 1.15.1

UPDATE:
I installed pod file, but also accidentally followed the steps for manually integrating the CodePush plugin from the code push documentation. After reverting manual integration steps back, the work around of @stewart42 of "React/RCTEventEmitter.h" worked for me. But without it, I still get the error of "RCTEventEmitter not found"

@silhouettes I tried the suggestion above and I am still getting the issue unfortunately.

I am seeing this on "react-native-code-push": "^1.15.1-beta" using react 25

I also tried the above steps and had the same results. I installed using rnpm link as well as the manual process

Thank you for the details - I suspect the issue is either with our compatibility with CocoaPods, or with RN 34. @bendellarocco, are you using CocoaPods? Also when you say 'react 25', do you mean [email protected]?

@silhouettes "react-native": "^0.25.1". I am not using Cocao Pods for this package. I am used rnpm link. And I also tried installing using the manual process. When I switched to v1.14.6-beta I no longer had this issue.

I tried a simple barebones app with [email protected], [email protected], and installation using react-native link, and was not able to reproduce.

I will follow up by trying the same thing with CocoaPods, and then the same thing with [email protected] (it is possible they are two separate issues).

FWIW, @silhouettes I am referencing codepush the pod file
pod 'CodePush', :path => './node_modules/react-native-code-push'

I am still unable to reproduce with [email protected], [email protected], and CocoaPods this time. @stewart42, @shrutic - are you able to show me your repo somehow? If not, would you like to do a Skype session sometime?

Are you all using swift?

Yes I am using swift.
@silhouettes, I have a few items I need to get done today, but I will try to get a sample app with the issue as soon as I can. If still no joy after that we could look to do a skype session.

Yes I am using Swift as well. I might be able to get a sample app next
week. Which version of Cocoapods are you using? I am using 1.0.1. Beyond
1.0.1, React native has issues for me and so until react native fixes this,
I am stuck at cocoapods 1.0.1

On Wed, Nov 16, 2016 at 3:15 AM, Stewart Scott [email protected]
wrote:

Yes I am using swift.
I have a few items I need to get done today, but I will try to get a
sample app with the issue as soon as I can.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/react-native-code-push/issues/583#issuecomment-260920157,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD8ySa7C4I64dQMRG7OLECT9aY6VcYTXks5q-uXKgaJpZM4Kg-r1
.

Okay, so I've set up a project from scratch using Swift and I've reproduced the issue! Thanks for your patience, fix will be coming shortly.

Oh awesome @silhouettes, thanks so much.

I'm also experiencing this issue. Is there a temporary workaround?

@dcvz either revert to 1.14.6-beta or change line 1 of CodePush.h to #import "React/RCTEventEmitter.h"

@silhouettes any ETA on this fix? Sorry to push, just planning some deployments.

I'm going to estimate 3 days on this, apologies for the wait!

The fix has been tested and published in [email protected] (release notes). Thank you so much for your patience, and feel free to come back if you run into any other issues!

@stewart42 @quinnliu @shrutic @bendellarocco @dcvz

To anyone this might benefit: I could not get this to work using cocoapods. I fixed it by installing codepush manually for iOS.

I might have an odd configuration, I don't know.

I am also running into this error using "react-native-code-push": "^1.16.1-beta" and "react-native": "0.35.0"

@IrvingAxelB - hi!
To avoid unexpected issues make sure you are using compatible versions of react-native and react-native-code-push (Supported React Native platforms).
I've also faced with this issue and fixed it by adding React to my Podfile:

  pod 'React', :path => '../node_modules/react-native'
  pod 'React/RCTGeolocation', :path => '../node_modules/react-native'
  pod 'React/RCTImage', :path => '../node_modules/react-native'
  pod 'React/RCTNetwork', :path => '../node_modules/react-native'
  pod 'React/RCTText', :path => '../node_modules/react-native'
  pod 'React/RCTWebSocket', :path => '../node_modules/react-native'
  pod 'CodePush', :path => '../node_modules/react-native-code-push'

I'm still facing this issue

"react-native": "0.50.4",
"react-native-code-push": "^5.2.1",

Hi @rafaelcorreiapoli, please feel free to create new issue and fill out the issue's template - we'll glad to help you.

i add it

  pod 'Firebase/Core'
  pod 'Firebase/Messaging'
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
  pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
  'BatchedBridge', # Required For React Native 0.45.0+
  'Core',
]

i'm using

"react-native": "0.51.1",
"react-native-code-push": "^5.3.3",
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Phredward picture Phredward  Â·  3Comments

osdnk picture osdnk  Â·  3Comments

quanzaiyu picture quanzaiyu  Â·  3Comments

fanzhiri picture fanzhiri  Â·  3Comments

Adr1ann picture Adr1ann  Â·  3Comments