Cordova-plugin-ionic-webview: Build error: use of undeclared identifier 'CDVUserAgentUtil'

Created on 2 May 2020  路  8Comments  路  Source: ionic-team/cordova-plugin-ionic-webview

Hi, I'm getting this error when I try to build for iOS:

:
use of undeclared identifier 'CDVUserAgentUtil'
   [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
    ^
/Users/vagrant/git/platforms/ios/[app]/Plugins/cordova-plugin-ionic-webview/CDVWKWebViewEngine.m
:
871
:
6
:
error
:
use of undeclared identifier 'CDVUserAgentUtil'
   [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
    ^
/Users/vagrant/git/platforms/ios/[app]/Plugins/cordova-plugin-ionic-webview/CDVWKWebViewEngine.m
:
878
:
91
:

It's the same thing happening here. Might it be related to this PR?

Env:

  • cordova: 9.x.x (latest)
  • cordova-ios: 6.0.0-dev (forked and updated the package.json to use latest cordova-node-xcode v3.0.0
  • ionic-webview version: 4.2.1

Most helpful comment

Just for the record: I got this error after upgrading the Cordova CLI to version 10 (npm i -g cordova) and adding plugins with Cordova 10. Cordova 10 suddenly added plugins to the devDependencies in package.json compared to Cordova 9 where it was in dependencies. Going back to version 9 (npm i -g cordova@9) made the error go away.

All 8 comments

I tried building with v4.2.0 of this plugin, and instead got only this error:

: 
no known instance method for selector 'userAgent'
    NSString* userAgent = [self.commandDelegate userAgent];
                                                ^~~~~~~~~
/Users/vagrant/git/platforms/ios/[app]/Plugins/cordova-plugin-file-transfer/CDVFileTransfer.m
:
390
:
52
:

So I went back to cordova-ios v5.1.1 and the error went away. This is with v4.2.0 of this plugin. Trying with v4.2.1.

Yes with cordova-ios v5.1.1 and latest version of this plugin (4.2.1) the problem goes away. Closing this issue.

Worked for me as well

That issue still valid :(

so how to solve it with ios version 5.? Thanks

Just for the record: I got this error after upgrading the Cordova CLI to version 10 (npm i -g cordova) and adding plugins with Cordova 10. Cordova 10 suddenly added plugins to the devDependencies in package.json compared to Cordova 9 where it was in dependencies. Going back to version 9 (npm i -g cordova@9) made the error go away.

@retoheusser perfect man!! I happen to install Cordova 10 by mistake. Didn't know 10 is latest now. Thanks a ton, downgrading to 9 fixed for me too

Was this page helpful?
0 / 5 - 0 ratings