-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[Android] Unable to recreateReactContextInBackground #14533
[Android] Unable to recreateReactContextInBackground #14533
Comments
Hey guys, would you have a chance please to take a look at this? Let me know if you need more info or need any help. |
Also have this issue, when runing in debug mode from Visual studio, since I ugrated a project from react native 0.41 to 0.45.1 . I don't know how to fix it... |
I can confirm that this issue also happens on a production app with the following details:
When downloading a fresh app from the Play Store, it crashes a few seconds after the first run (probably because it's trying to do a restart like mentioned above). (Interesting to see if it happens also on 0.45.0) |
0.45.0 to .1 is only a small update of the packanger that was referencing a wrong path for the cli to pick up. However, 0.45.x uses a slightly different way of handling the js in the delegate file.
|
@D1no I don't know about a fresh project. Need to check it. |
Hi @D1no, thank you for the assistance, please let me know if you need any help. |
Hi @D1no, thanks for your help. I also should mention, that the issues reproduces for 0.45.x only and we have not seen such kind of issues before, another words - the issue does not reproduce for previous versions of RN (0.44.x, 0.43.x and so on). |
Hey guys, I've figured out what goes wrong here - we need to perform the following commands on attached root views in instanceManager: reactRootView.removeAllViews();
reactRootView.setId(View.NO_ID); The details are here: https://github.com/Microsoft/react-native-code-push/pull/901/files#diff-99865b122cb5308ab005ac99ccb55da0R185 So could someone please tell me why those lines that fixes the exception has been removed from RN 0.45? - I'm going to create PR that will fix it in RN itself, but good to know what was wrong with those lines and why they have been removed. |
Having this same crash as well. Will try the fix above. Edit: it works |
Hi @andrepcg, great! Thanks for the response, going to release version 3.0.0 of react-native-code-push on the next week. |
Wow that was quick! Congrats! |
Thank you! We are eagerly waiting for it (: |
Can we keep this issue open? Because it might be fixed in react-native-code-push but is is not in react-native in general where this issue remain.... |
Hi @ramsestom, sure, I've closed it by mistake, sorry for it. |
Hey guys, as I can see - the fix I've implemented for react-native-code-push is currently in master branch here . And the previous version of RN 0.45.1 does not contain this changes. So the issue probably should be fixed in next versions of RN. |
The issue has been fixed in c639a1f, closing this. |
Still have this issue:
Using RN 0.53.3 (and 0.51.0) UPDATE: This was probably because it was called multiple times, so fixed it by calling once. But still this is a bug. |
Hey guys,
Description
There is an issue with
recreateReactContextInBackground()
method after upgrading React Native version from 0.44.3 to 0.45.1:I have RN project that uses CodePush SDK and I want to call
CodePush.restartApp
method, but I'm receiving the error above.To restart an app (reload js bundle)
CodePush.restartApp
method usesloadBundle
method andloadBundle
method usesrecreateReactContextInBackground()
to recreate context and load new js bundle:restartApp -> loadBundle -> recreateReactContextInBackground
I'm expecting that react context will be recreated successfully without no errors.
Reproduction Steps
npm i
gradlew assembleDebug
(I'm usingbundleInDebug: true
)Restart App
Sample Code
Here is app sample. rncp210release.zip
Source code:
Additional Information
The text was updated successfully, but these errors were encountered: