cordova-plugin-code-push
cordova-plugin-code-push copied to clipboard
cordova-plugin-code-push 1.12.5 conflicts with cordova-plugin-wkwebview-engine 1.2.1 "Cordova WKWebView Engine"
Hello,
Description
If you install both code push and wkwebview in cordova app, the application on ios-cordova fails to start, it just stays with a white screen, and all you can read from the XCode console is:
Failed to load webpage with error: unsupported URL Also, app is not inspectable via safari. In some rare cases i could open the inspector, and it just showed about:blank
After recreating app from scratch, and adding one plugin at a time, i concluded that these two plugins versions are not compatible. Solved by downgrading code-push to version 1.12.0 with cordova plugin add [email protected]
Reproduction
start new cordova project cordova plugin add cordova-plugin-wkwebview-engine cordova plugin add [email protected] (or @latest at the time of writing this post)
Version 1.12.0 of code push works, but i can't tell why.
I spent around 4 hours to understand why code push isn't working on new project. @pietromanneschi thank you for advising to downgrade code-push package.
@pietromanneschi @mahoho please post the output of running the following command in the root directory of your project (where you have package.json
):
cordova plugin list
@ermik sure
code-push 3.0.1 "CodePushAcquisition" cordova-plugin-android-notch 1.0.0 "AndroidNotch" cordova-plugin-camera 4.1.0 "Camera" cordova-plugin-device 2.0.3 "Device" cordova-plugin-dialogs 2.0.2 "Notification" cordova-plugin-file 6.0.2 "File" cordova-plugin-file-transfer 1.7.1 "File Transfer" cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard" cordova-plugin-screen-orientation 3.0.2 "Screen Orientation" cordova-plugin-statusbar 2.4.3 "StatusBar" cordova-plugin-whitelist 1.3.4 "Whitelist" cordova-plugin-wkwebview-engine 1.2.1 "Cordova WKWebView Engine" cordova-plugin-zip 3.1.0 "cordova-plugin-zip" cordova-support-google-services 1.3.2 "cordova-support-google-services" es6-promise-plugin 4.2.2 "Promise" phonegap-plugin-multidex 1.0.0 "Multidex" phonegap-plugin-push 2.3.0 "PushPlugin"
here is also the content of package.json
{ "name": "****", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "serveTest": "vue-cli-service serve --mode test", "build": "vue-cli-service build --dest www", "ios": "vue-cli-service build --dest www && cordova build ios", "iosProd": "vue-cli-service build --dest www --mode prod && cordova build ios", "android": "vue-cli-service build --dest www && cordova run android", "androidTest": "vue-cli-service build --dest www --mode test && cordova run android", "androidProd": "vue-cli-service build --dest www --mode prod && cordova build android --release", "lint": "vue-cli-service lint", "generatemodel": "nswag run nswag\nswagModel.json", "generateclient": "nswag run nswag\nswagClient.json", "generateall": "npm run generatemodel && npm run generateclient" }, "dependencies": { "axios": "^0.19.0", "bootstrap": "^4.3.1", "code-push": "^3.0.1", "cordova-android": "^8.1.0", "cordova-ios": "^5.1.1", "cordova-plugin-android-notch": "^1.0.3", "cordova-plugin-appcenter-analytics": "^0.5.1", "cordova-plugin-appcenter-crashes": "^0.5.1", "cordova-plugin-appcenter-shared": "^0.5.1", "cordova-plugin-camera": "^4.1.0", "cordova-plugin-code-push": "^1.12.0", "cordova-plugin-dialogs": "^2.0.2", "cordova-plugin-file": "^6.0.2", "cordova-plugin-file-transfer": "^1.7.1", "cordova-plugin-inappbrowser-wkwebview": "^1.0.7", "cordova-plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-screen-orientation": "^3.0.2", "cordova-plugin-statusbar": "^2.4.3", "cordova-plugin-wkwebview-engine": "^1.2.1", "cordova-plugin-zip": "^3.1.0", "core-js": "^2.6.5", "moment": "^2.24.0", "nswag": "^13.0.6", "phonegap-plugin-multidex": "^1.0.0", "phonegap-plugin-push": "^2.3.0", "popper.js": "^1.14.7", "swiper": "^5.0.4", "vue": "^2.6.10", "vue-barcode": "^1.2.0", "vue-class-component": "^7.0.2", "vue-moment": "^4.1.0", "vue-property-decorator": "^8.1.0", "vue-router": "^3.0.3", "vue-toasted": "^1.1.27", "vuex": "^3.0.1" }, "devDependencies": { "@fortawesome/fontawesome-free": "^5.10.1", "@vue/cli-plugin-babel": "^3.10.0", "@vue/cli-plugin-typescript": "^3.10.0", "@vue/cli-service": "^3.10.0", "cordova-plugin-crop": "~0.4.0", "cordova-plugin-googlemaps": "^2.6.2", "cordova-plugin-whitelist": "1", "typescript": "^3.4.3", "vue-template-compiler": "^2.6.10" }, "postcss": { "plugins": { "autoprefixer": {} } }, "browserslist": [ "> 1%", "last 2 versions" ], "cordova": { "plugins": { "cordova-plugin-device": {}, "cordova-plugin-file-transfer": {}, "cordova-plugin-camera": { "ANDROID_SUPPORT_V4_VERSION": "27.+" }, "cordova-plugin-android-notch": {}, "cordova-plugin-wkwebview-engine": {}, "cordova-plugin-zip": {}, "cordova-plugin-statusbar": {}, "cordova-plugin-screen-orientation": {}, "phonegap-plugin-push": { "ANDROID_SUPPORT_V13_VERSION": "27.+", "FCM_VERSION": "17.0.+" }, "cordova-plugin-file": {}, "cordova-plugin-whitelist": {}, "cordova-plugin-code-push": {}, "cordova-plugin-crop": {}, "cordova-plugin-appcenter-analytics": {}, "cordova-plugin-appcenter-crashes": {}, "cordova-plugin-inappbrowser-wkwebview": {}, "cordova-plugin-ionic-keyboard": {} }, "platforms": [ "ios" ] } }
Here is mine: code-push 3.0.1 "CodePushAcquisition" cordova-open-native-settings 1.5.2 "Native settings" cordova-plugin-advanced-http 3.0.0 "Advanced HTTP plugin" cordova-plugin-androidx 2.0.0 "cordova-plugin-androidx" cordova-plugin-androidx-adapter 1.1.1 "cordova-plugin-androidx-adapter" cordova-plugin-badge 0.8.8 "Badge" cordova-plugin-code-push 1.12.5 "CodePush" cordova-plugin-cors 1.0.0 "CORS" cordova-plugin-device 2.0.3 "Device" cordova-plugin-dialogs 2.0.2 "Notification" cordova-plugin-file 6.0.2 "File" cordova-plugin-file-transfer 1.6.3 "File Transfer" cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification" cordova-plugin-network-information 2.0.2 "Network Information" cordova-plugin-screen-orientation 3.0.2 "Screen Orientation" cordova-plugin-splashscreen 5.0.4 "Splashscreen" cordova-plugin-urlhandler 0.7.0 "URLHandler" cordova-plugin-whitelist 1.3.4 "Whitelist" cordova-plugin-wkwebview-engine 1.2.1 "Cordova WKWebView Engine" cordova-plugin-zip 3.1.0 "cordova-plugin-zip" es6-promise-plugin 4.2.2 "Promise" wifiwizard2 3.1.1 "WifiWizard2"
Hi all, Thanks for reporting!
Could you please check your app with latest cordova-plugin-code-push
version 1.13.0?
Please let me know if it was successful or you still have this issue?
Hi all, Thanks for reporting!
Could you please check your app with latest
cordova-plugin-code-push
version 1.13.0? Please let me know if it was successful or you still have this issue?
Hello, I have tried with version 1.13.0, still the exact same problem. Then i tried with version 1.13.1, uploaded like one hour ago, and the problem is the same. The difference is that now there is an alert, other than the console logging.
Still, problem not solved
I can also confirm this is an issue with 1.13.0. I receive the following error:
Failed to load webpage with error: unsupported URL
Any news or progress?
Any news or progress?
no, not at all. We are still using the old version in our apps.
BUT, we found another conflict. With phonegap-plugin-push this time. If you install codepush plugin BEFORE the phonegap-plugin-push plugin, push notifications won't work.
We found no other way to fix the problem but to uninstall both plugins, reinstall phonegap-plugin-push, and only install codepush as a last one
Any news or progress?
I have been successfully using my fork in production for since Aug 29. The issue is happening because the plugin assumes the project is using Ionic in some cases and changes the URL to "ionic://...", which of course is invalid.
https://github.com/microsoft/cordova-plugin-code-push/compare/master...Pigsnuck:master
As you can see, I simply commented out the code which assumes the project is using Ionic (I am using pure Cordova). Not a solution for everyone, but perhaps it will get a few developers through the pinch until there is a proper fix.