Closed NoelMiranda1 closed 1 year ago
-----FIX-----
@NoelMiranda1
I've faced with the same issue and fixed it by overriding getJSBundleFile method inside MainApplicationReactNativeHost class. The problem was I was using new architecture for android but documentation only talks about overriding getJSBundleFile method inside ReactNativeHost (which is used if newarchitecture is disabled)
...
// 1. Import the plugin class.
import com.microsoft.codepush.react.CodePush;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
...
// 2. Override the getJSBundleFile method in order to let
// the CodePush runtime determine where to get the JS
// bundle location from on each app start
@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}
};
}
but if the new architecture is enabled react-native uses MainApplicationReactNativeHost which is inside "newarchitecture" folder of your project. So just override this method there as well and it will work. (It did work on my case at least).
I think it should have been pointed out on Android Setup docs as well
-----FIX-----
@NoelMiranda1
I've faced with the same issue and fixed it by overriding getJSBundleFile method inside MainApplicationReactNativeHost class. The problem was I was using new architecture for android but documentation only talks about overriding getJSBundleFile method inside ReactNativeHost (which is used if newarchitecture is disabled)
... // 1. Import the plugin class. import com.microsoft.codepush.react.CodePush; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { ... // 2. Override the getJSBundleFile method in order to let // the CodePush runtime determine where to get the JS // bundle location from on each app start @Override protected String getJSBundleFile() { return CodePush.getJSBundleFile(); } }; }
but if the new architecture is enabled react-native uses MainApplicationReactNativeHost which is inside "newarchitecture" folder of your project. So just override this method there as well and it will work. (It did work on my case at least).
I think it should have been pointed out on Android Setup docs as well
This does not accompany my problem since I do not have the new RN architecture, in the same way I have tried it without success
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.
This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.
This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.
Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):
Steps to Reproduce
Expected Behavior
What you expected to happen? That the update is installed correctly
Actual Behavior
What actually happens?
Environment