Recently updated to cordova-android 10.0.1 and one of the breaking changes in the major release was the usage of WebViewAssetLoader in favor of loading assets from file:// (https://github.com/apache/cordova-android/pull/1137, read more at https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html). This change unfortunately does not work for cordova-plugin-code-push and (based on the console output) the code-push package never installs correcty and an update is never received on the mobile app. Only when adding the fallback <preference name="AndroidInsecureFileModeEnabled" value="true" />,reverting to the previous default setup of cordova-android, to the config.xml this started working again. While this works for now, this seems to be considered insecure in the long-term.
Console output from connected Chrome dev tools:
codePushUtil.js:41 [CodePush] Preinstall failure. Could not get the package start page
codePushUtil.js:41 [CodePush] An error has occurred while installing the package. Could not get the package start page. StackTrace: Error: An error has occurred while installing the package. Could not get the package start page
at preInstallFailure (https://localhost/plugins/cordova-plugin-code-push/bin/www/localPackage.js:255:41)
at Object.callbackFromNative (https://localhost/cordova.js:297:52)
at processMessage (https://localhost/cordova.js:1134:17)
at processMessages (https://localhost/cordova.js:1157:9)
Excepted behavior
Code push update (sync) should work without issues with latest cordova-android (>=10).
Reproduction
1) Install latest cordova-android platform (currently 10.0.1 in a code-push enabled project
2) Try to push a new update for your code via code-push to the application (without adding <preference name="AndroidInsecureFileModeEnabled" value="true" /> to the project's config.xml file.
Description
Recently updated to cordova-android
10.0.1
and one of the breaking changes in the major release was the usage ofWebViewAssetLoader
in favor of loading assets fromfile://
(https://github.com/apache/cordova-android/pull/1137, read more at https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html). This change unfortunately does not work forcordova-plugin-code-push
and (based on the console output) the code-push package never installs correcty and an update is never received on the mobile app. Only when adding the fallback<preference name="AndroidInsecureFileModeEnabled" value="true" />
,reverting to the previous default setup of cordova-android, to the config.xml this started working again. While this works for now, this seems to be considered insecure in the long-term.Console output from connected Chrome dev tools:
Excepted behavior
Code push update (sync) should work without issues with latest
cordova-android
(>=10
).Reproduction
1) Install latest
cordova-android
platform (currently10.0.1
in a code-push enabled project 2) Try to push a new update for your code via code-push to the application (without adding<preference name="AndroidInsecureFileModeEnabled" value="true" />
to the project's config.xml file.Additional Information
cordova-plugin-code-push version: 2.0.0
List of installed plugins:
Cordova version: 10.0.0
iOS/Android/Windows version: Android 11
Does this reproduce on a debug build or release build?
Release build only.
Only tried on a physical device and only experienced it there.
Thank you very much.