-
Notifications
You must be signed in to change notification settings - Fork 1.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 crash with InstallMode.IMMEDIATE - IllegalViewOperationException: Trying to remove a view index above child count #986
Comments
Hi @AndrewJack, thanks for reaching us. No, I've not seen similar issues.
|
Thanks, I don't think there is any chance of mixing RN versions, they are all targeted at the correct binary versions. I will try to reproduce in a simpler sample app. |
@AndrewJack, got it, thank you, please let us know if you have any updates or have any questions. |
Hi @AndrewJack, just a friendly ping - do you have any updates on this? |
Hey sorry, I'm a bit busy right now. I've worked around my problem for now by removing the immediate update. Feel free to close this issue. I'll reopen when I have more information. |
Got it, thanks for the update! |
@AndrewJack , Even I am facing the same error with RN 0.45.1 and RNCP 3.0.0-beta. My CodePush configuration is CodePush.sync(
{ updateDialog: true, installMode: CodePush.InstallMode.IMMEDIATE },
status => {
switch (status) {
case CodePush.SyncStatus.DOWNLOADING_PACKAGE:
this.setState({ showDownloadingModal: true });
this._modal.open();
break;
case CodePush.SyncStatus.INSTALLING_UPDATE:
this.setState({ showInstalling: true });
break;
case CodePush.SyncStatus.UPDATE_INSTALLED:
this._modal.close();
this.setState({ showDownloadingModal: false });
break;
default:
break;
}
},
({ receivedBytes, totalBytes }) => {
this.setState({ downloadProgress: receivedBytes / totalBytes * 100 });
}
); What is the install mode you set which got your code push working? |
Removing this piece of code from UPDATE_INSTALLED case made my code-push working this._modal.close(); So my UPDATE_INSTALLED case is just empty. |
FYI - removing any state changes after a |
Yup,I too face same issue it is not happening on debug mode it is happening on release apk only. After removing setState code under UPDATE_INSTALLED it is working fine. Guess it is accessing state which is not there |
@sood03 How did you end up closing your modal then? I'm depending on state to know when codepush is finished installing the update. Only then do I actually render my App component. How would I know when codepush is finished? |
@Li357 Did you ever figure this out? I'm wondering the same thing.... How to show the app content once the update is complete. I'm making a wild guess that the second time the app is loaded that it will trigger UP_TO_DATE, which can then close the loading screen? |
I can actually confirm that it works. Seems my UP_TO_DATE case that closes my loading screen is good enough. |
@tmaly1980 @vinaysmart @sergey-akhalkov In my app I have removed all setState in codepush notifications. We are not doing anything in codepush notifications except logging. Still we face this issue. About 2-3% of the users are facing this issue. In our app we dont do anything in codepush notifications, so the app continues rendering the screens. Then the user will start using the app when the codepush download/install is in progress. If we dont have any logic in notifications then how to avoid user to stop using the app? since the user is using the app there will be some setState in the app, which may be causing this issue. Also I have noticed then after the codepush gives UPDATE_INSTALLED notification, app is not restarting. I have tested by killing and opening the app. Codepush is downloading/installing the update, the changes are reflected in app but there is no restart(I have added logs in the constructor to verify this) |
I wondered if you'd seen something similar in facebook/react-native#14533? @sergey-akhalkov ?
Steps to Reproduce
InstallMode.IMMEDIATE
Only occurs when the app is upgrading, but I can't see if it is doing anything different so far.
Expected Behaviour
App Restarts
Actual Behavior
What actually happens?
App will crash with following stacktrace.
Environment
The text was updated successfully, but these errors were encountered: