Not compatible with cordova-ios 6
Description
The cordova-plugin-code-push plugin depends on the deprecated (since 2017) cordova-plugin-file-transfer plugin, which is not compatible with cordova-ios 6 and results in compiler issues.
The ideal solution here would be for cordova-plugin-code-push to handle the downloading, unzipping, and installation of app bundles in native code, that same way that react-native-code-push does.
Reproduction
Install cordova-plugin-code-push in an app built with cordova-ios 6. There are compiler errors in the cordova-plugin-file-transfer Objective C files.
Additional Information
- cordova-plugin-code-push version: 1.12.4
- List of installed plugins: cordova-plugin-code-push
- Cordova version: CLI 9.0.0 with [email protected]
- iOS/Android/Windows version: iOS 13.5
- Does this reproduce on a debug build or release build? Both
- Does this reproduce on a simulator, or only on a physical device? Both
Hi,
I have the same error.
D.
I’m having the same problem. Juggling plugin versions for IOS with the WebKit restriction has led me to remove the cordova-plugin-file-transfer but that breaks code push
Hi, I have the same problem.
help plz...
I downgraded cordova-ios to 5.1.1 and added file transfer back and everything seems to be working now. The eco system is so fragile.
Related to these issues #485 and #341. There's already a pull request #513 to remove file transfer, but Microsoft has neglected to merge it.
cordova-ios 6 also removed CDVUserAgentUtil, which this plugin is still referencing.
Use of undeclared identifier 'CDVUserAgentUtil'
Switched to cordova-ios 5.1.1 because of that issue 🤦 https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/561
cordova-ios 6 is a major update those changes are a requirement by Apple. In order to remain compliant in their ecosystem. UIWebView is not allowed anymore. It's important to update this plugin.
Use of undeclared identifier 'CDVUserAgentUtil'Switched to cordova-ios 5.1.1 because of that issue 🤦 ionic-team/cordova-plugin-ionic-webview#561
@bobrosoft The cordova-ios 5.1.1 works well with code-push 1.12.0, but it will trigger the following issue if submitted to app store. May I know how you remove the UIWeivew from cordova-ios 5.1.1? Refer to this https://github.com/apache/cordova-ios/pull/773 ?
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability.
@NickChowHK yes, solved by using:
- "cordova-ios": "^5.1.1",
- "cordova-plugin-code-push": "^1.12.5",
- "cordova-plugin-ionic-webview": "^5.0.0",
and adding next to <platform name="ios"> section of the config.xml:
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
@barryvdh yes with cordova-ios <6 this plugin works. The problem is that the apple ecosystem has changed and you will not be able to publish in the App Store with this plugin soon unless it is updated and guarantees compatibility with cordova-ios 6+.
With cordova-plugin-ionic-webview 5+ --> I think that you don't need this lines because only the WK engine is available now
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
@NickChowHK yes, solved by using:
- "cordova-ios": "5.1.1",
- "cordova-plugin-code-push": "1.12.0",
- "cordova-plugin-ionic-webview": "5.0.0",
and adding next to
<platform name="ios">section of theconfig.xml:<preference name="WKWebViewOnly" value="true" /> <feature name="CDVWKWebViewEngine"> <param name="ios-package" value="CDVWKWebViewEngine" /> </feature> <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
@bobrosoft That's what I tried before..... however, it still triggers the ITMS-90809: Deprecated API Usage when I submit a new app yesterday.
Apple rejected the app even the app is running on WKWebview as the UIWebview Code exists in the [email protected] and [email protected]
@NickChowHK clean everything, delete plugins folder, node_modules etc, everything temporary, platforms folder, rm -rf ~/Library/Developer/Xcode/DerivedData etc, ensure correct plugin version installed, check installed versions manually, set <plugin name="cordova-plugin-ionic-webview" spec="^5.0.0" /> in config.xml just in case (but I don't think it matters). I was able to push app without that warning, so, solved for me.
@NickChowHK other solution will be to drop code-push and use latest cordova-ios.
@NickChowHK You need to be on at least version 1.12.1 of this plugin to fix the WKWebView issue.
@NickChowHK yes, I double-checked now, I actually have cordova-plugin-code-push version 1.12.5 installed, not 1.12.0. Sorry for misinform. What I don't understand now is from where it gets that 1.12.5 because in node_modules I see 1.12.0 installed definitely and I thought it is getting code from there, but looks as it resolves deps separately.
Working iOS and Android with defaults platform versions.
Ionic:
Ionic CLI : 6.10.1 (/Users/ludufre/.npm-packages/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.2.3
@angular-devkit/build-angular : 0.901.11
@angular-devkit/schematics : 9.1.11
@angular/cli : 9.1.11
@ionic/angular-toolkit : 2.2.0
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 8.1.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 9 other plugins)
Utility:
cordova-res : 0.15.1
native-run : 1.0.0
System:
Android SDK Tools : 26.1.1 (/Users/ludufre/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v12.18.1 (/usr/local/bin/node)
npm : 6.14.5
OS : macOS
Xcode : Xcode 11.6 Build version 11E708
With [email protected] get error with deprecated CDVUserAgentUtil:

I didn't find any code that [CDVUserAgentUtil ...acquireLock] so I commented that line and compiled and worked perfectly in 6.1.1.
I made that small change, here it is: https://github.com/ludufre/cordova-plugin-code-push/commit/159e18cfa9e2aa0c5c6d47ca7b3f0e1d2b1c9f1e (I new on this Github thing, so I don't know how to send this change to this Pull Request / Or @ermik can do this change himself)
Originally posted by @ludufre in https://github.com/microsoft/cordova-plugin-code-push/pull/513#issuecomment-660669212
@ermik is not a valid solution, cordova file transfer plugin is deprecated and must be removed in this plugin. In resume is not valid if you want to upload to market.
Originally posted by @ludufre in #513 (comment)
@videmort As you can see at the bottom of my comment, I'm just reposting the relevant information which was provided by @ludufre in #513, so that it does not get unnoticed.
@ermik 👍