我们正在尝试从 Microsoft App Center 实施 CodePush。我们已经成功地到达了应用程序下载包并解包的地步。但是,它总是以响应结束
Update is invalid - A JS bundle file named "null" could not be found within the downloaded contents. Please check that you are releasing your CodePush updates using the exact same JS bundle file name that was shipped with your app's binary.
- 反应@16.2.0
- 反应原生@0.53.3
- react-native-code-push@5.3.2
我们对 MainApplication.java 进行了更改
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@NonNull
@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}
和
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
// Add additional packages you require here
// No need to add RnnPackage and MainReactPackage
new ActionSheetPackage(),
new PickerPackage(),
new ReactNativeOneSignalPackage(),
new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG),
new CalendarEventsPackage()
);
}
在应用程序代码中,我们调用
Navigation.registerComponent(ScreenNames.Landing.id, () => CodePush(codePushOptions)(LandingScreen), store, Provider);
来自 code-push debug android 的最终日志
[11:31:37] Awaiting user action.
[11:31:42] Downloading package.
[11:31:43] An unknown error occurred.
[11:31:43] Update is invalid - A JS bundle file named "null" could not be found within the downloaded contents. Please check that you are releasing your CodePush updates using the exact same JS bundle file name that was shipped with your app's binary.