svassr
svassr

Reputation: 5668

Build errors after updating to cordova 5.0.0 (CordovaChromeClient, DroidGap, CordovaWebView)

I'm trying to update Cordova to 5.0.0 in a project originaly build with 2.7.0 (I know it's a long shot).

I started a brand new cordova project and copied my frontend build to www/ folder. I also copied my custom libs to platform/android/libs/ and platform/android/src/.

When building with cordova CLI (cordova build android) I receive several errors:


error: cannot find symbol
import org.apache.cordova.CordovaChromeClient;
                         ^
error: cannot find symbol
import org.apache.cordova.DroidGap;
                         ^
error: no interface expected here
public class MyWebView extends CordovaWebView
                                        ^
error: cannot find symbol
import org.apache.cordova.CordovaWebViewClient;
                         ^

It seems there are no plugin corresponding to those classes and cordova sources still refer to it but it's not there.

Since cordova 3.3.0 Cordova is used as a Library Project instead of a .jar, so .jar file is not mandatory.

Droidgap has been deprecated for CordovaActivity.

What about CordovaChromeClient and CordovaWebView? Are those deprecated as well?

Upvotes: 2

Views: 1292

Answers (1)

Richard Le Mesurier
Richard Le Mesurier

Reputation: 29722

For the CordovaWebView the issue is that you are trying to extend, rather than implement it. CordovaWebView is an interface, not a class.

You may want to change your code to something like:

public class MyWebView implements CordovaWebView

Or you can inherit from CordovaWebViewImpl, which is a class that already implements CordovaWebView:

public class MyWebView extends CordovaWebViewImpl

It looks like CordovaChromeClient was removed in v4.0.0 when they made some changes to their default webview.

Upvotes: 2

Related Questions