cordova-plugin-code-push icon indicating copy to clipboard operation
cordova-plugin-code-push copied to clipboard

Support for cordova-android>=10.0.0 WebViewAssetLoader default

Open torte opened this issue 2 years ago • 1 comments

Description

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:

Screen Shot 2021-08-06 at 3 04 31 pm

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.

Additional Information

  • cordova-plugin-code-push version: 2.0.0

  • List of installed plugins:

@havesource/cordova-plugin-push 2.0.1-dev.0 "Cordova Push Plugin"
code-push 3.0.1 "CodePushAcquisition"
cordova-plugin-advanced-http 3.1.1 "Advanced HTTP plugin"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-audioinput 1.0.2 "Audio Input"
cordova-plugin-camera 5.0.2 "Camera"
cordova-plugin-code-push 2.0.0 "CodePush"
cordova-plugin-deeplinks 1.1.1 "Cordova Deeplinks Plugin"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-keyboard 1.2.0 "Keyboard"
cordova-plugin-splashscreen 6.0.0 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-webviewcolor 2.2.0 "WebView background color plugin"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
  • Cordova version: 10.0.0

  • iOS/Android/Windows version: Android 11

  • Does this reproduce on a debug build or release build?

Release build only.

  • Does this reproduce on a simulator, or only on a physical device?

Only tried on a physical device and only experienced it there.

Thank you very much.

torte avatar Aug 06 '21 05:08 torte

I have the same problem!

veneliniliev avatar Oct 01 '21 14:10 veneliniliev