When InstallMode.ON_NEXT_RESUME is used on android the app will go into a restart loop and crash the app.
{
checkFrequency: CheckFrequency.ON_APP_RESUME,
installMode: InstallMode.ON_NEXT_RESUME
}
onResume -> loadBundleI think the cause is around here - https://github.com/Microsoft/react-native-code-push/blob/master/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java#L470
Trying to reproduce on the Example
Hi @AndrewJack, thanks for reaching us.
Trying to reproduce on the Example
Got it, this would be very helpful for investigation, please let me know if any updates.
@sergey-akhalkov I've figured it out.
Then this happens:
loadBundle is called from onHostResume CodePushNativeModule.java#L473loadBundleLegacy is called - CodePushNativeModule.java#L84onHostResume again - starting the infinite loop - CodePushNativeModule.java#L473Do we still need this legacy support in v2 of code push? Now v2 only support RN v0.43?
I've fixed my code by adding -keep class com.facebook.react.** { *; } for now
I previously had:
-keep class com.facebook.react.cxxbridge.** { *; }
-keep class com.facebook.react.bridge.** { *; }
which worked fine except for code push
Things to fix:
@AndrewJack, thank you for such great investigation! I think we can remove support for old react native versions due to breaking changes that have been released in v2.0.1-beta. We'll fix the issue asap, but if you have a time and ability you could help us to deliver this fix much faster (due to you already have configured environment) by publishing pull request - we'll be very grateful.
Please let us know if it works for you (if not, we'll start investigating and fixing it asap) or if you have any questions.
https://github.com/Microsoft/react-native-code-push/pull/845 - let me know if you need anything changed
I'm surprised code push doesn't have an supported react native api to setJSBundle yet.
@AndrewJack, thank you for the contribution! I'll review it and notify you if needed.
I'm surprised code push doesn't have an supported react native api to setJSBundle yet.
I suppose that React Native module for CodePush have been implemented a long time ago and have supported big amount of react-native versions until v2.0.1-beta. As of now I think code-push could support react native api to setJSBundle. We'll investigate and implement it, thank you for your advice. Please also let me know if you have any thoughts/advises that could help us to implement this better way.