Ionic-cli: bug: Error when compiling app with Crosswalk

Created on 13 Apr 2015  路  16Comments  路  Source: ionic-team/ionic-cli

_From @jesusbotella on April 11, 2015 12:41_

Type: bug

Platform: android 4.x webview

Hi!

We added Crosswalk to our ionic project from ionic-cli when it was released and there wasn't any problem until today.

Today, after changing some stuff in one of our custom plugins, I had to rebuild the android project (platform remove, platform add, add crosswalk browser...) and when I try to compile it, it shows me a lot of errors related with crosswalk which I cannot resolve.

To compile in android, I had to change compileSdkVersion, and buildToolsVersion in gradle file to match api 21 because one of our custom plugins needs it. Also, I added some dependencies like volley and appcompat. But these stuff was added before and the project compiled successfully.

So I have not been able to know what is going on here.

I'm using Crosswalk 11.40.277.7, but I tested with other ones and the thing wasn't better.

I attach the errors which shows up:

/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaResourceClient.java:25: error: cannot find symbol
import org.apache.cordova.CordovaUriHelper;
^
symbol: class CordovaUriHelper
location: package org.apache.cordova
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaResourceClient.java:55: error: cannot find symbol
private CordovaUriHelper helper;
^
symbol: class CordovaUriHelper
location: class XWalkCordovaResourceClient
/Users/jesus/Savelist/android/platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java:692: error: cannot find symbol
if (!isLocalTransfer && !Config.isUrlWhiteListed(source)) {
^
symbol: method isUrlWhiteListed(String)
location: class Config
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaResourceClient.java:93: error: cannot find symbol
helper = new CordovaUriHelper(appView.cordova, appView);
^
symbol: class CordovaUriHelper
location: class XWalkCordovaResourceClient
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:68: error: XWalkCordovaWebView is not abstract and does not override abstract method getEngine() in CordovaWebView
public class XWalkCordovaWebView implements CordovaWebView {
^
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:132: error: constructor LoadUrlBridgeMode in class LoadUrlBridgeMode cannot be applied to given types;
nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.LoadUrlBridgeMode(this, cordova));
^
required: CordovaWebViewEngine,CordovaInterface
found: XWalkCordovaWebView,CordovaInterface
reason: actual argument XWalkCordovaWebView cannot be converted to CordovaWebViewEngine by method invocation conversion
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:144: error: constructor CordovaBridge in class CordovaBridge cannot be applied to given types;
bridge = new CordovaBridge(pluginManager, nativeToJsMessageQueue, this.cordova.getActivity().getPackageName());
^
required: PluginManager,NativeToJsMessageQueue
found: PluginManager,NativeToJsMessageQueue,String
reason: actual and formal argument lists differ in length
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:116: error: method does not override or implement a method from a supertype
@Override
^
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:286: error: cannot find symbol
bridge.getMessageQueue().addJavaScript(statement);
^
symbol: method getMessageQueue()
location: variable bridge of type CordovaBridge
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:295: error: cannot find symbol
bridge.getMessageQueue().addPluginResult(result, callbackId);
^
symbol: method getMessageQueue()
location: variable bridge of type CordovaBridge
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:328: error: method does not override or implement a method from a supertype
@Override
^
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:584: error: method reset in class CordovaBridge cannot be applied to given types;
bridge.reset(loadedUrl);
^
required: no arguments
found: String
reason: actual and formal argument lists differ in length
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:587: error: method does not override or implement a method from a supertype
@Override
^
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:612: error: method does not override or implement a method from a supertype
@Override
^
/Users/jesus/Savelist/android/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:617: error: method does not override or implement a method from a supertype
@Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
15 errors

_Copied from original issue: driftyco/ionic#3508_

Most helpful comment

I have the same problem, after i compare the package.json with working one, found that the plugin cordova-plugin-crosswalk-webview is at version 1.7.x, while working one uses version 2.2.0.

cordova plugin rm cordova-plugin-crosswalk-webview
cordova plugin add [email protected]

Then there is no problem of "ionic build android"

All 16 comments

Same here with [email protected]

/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaResourceClient.java:25: error: cannot find symbol
import org.apache.cordova.CordovaUriHelper;
                         ^
  symbol:   class CordovaUriHelper
  location: package org.apache.cordova
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaResourceClient.java:55: error: cannot find symbol
    private CordovaUriHelper helper;
            ^
  symbol:   class CordovaUriHelper
  location: class XWalkCordovaResourceClient
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaResourceClient.java:93: error: cannot find symbol
        helper = new CordovaUriHelper(appView.cordova, appView);
                     ^
  symbol:   class CordovaUriHelper
  location: class XWalkCordovaResourceClient
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:68: error: XWalkCordovaWebView is not abstract and does not override abstract method getEngine() in CordovaWebView
public class XWalkCordovaWebView implements CordovaWebView {
       ^
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:130: error: constructor NativeToJsMessageQueue in class NativeToJsMessageQueue cannot be applied to given types;
        bridge = new CordovaBridge(pluginManager, new NativeToJsMessageQueue(this, cordova), this.cordova.getActivity().getPackageName());
                                                  ^
  required: no arguments
  found: XWalkCordovaWebView,CordovaInterface
  reason: actual and formal argument lists differ in length
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:116: error: method does not override or implement a method from a supertype
    @Override
    ^
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:272: error: cannot find symbol
        bridge.getMessageQueue().addJavaScript(statement);
              ^
  symbol:   method getMessageQueue()
  location: variable bridge of type CordovaBridge
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:281: error: cannot find symbol
        bridge.getMessageQueue().addPluginResult(result, callbackId);
              ^
  symbol:   method getMessageQueue()
  location: variable bridge of type CordovaBridge
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:314: error: method does not override or implement a method from a supertype
    @Override
    ^
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:570: error: method reset in class CordovaBridge cannot be applied to given types;
        bridge.reset(loadedUrl);
              ^
  required: no arguments
  found: String
  reason: actual and formal argument lists differ in length
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:573: error: method does not override or implement a method from a supertype
    @Override
    ^
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:598: error: method does not override or implement a method from a supertype
    @Override
    ^
/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/src/org/crosswalk/engine/XWalkCordovaWebView.java:603: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
13 errors
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileArmv7DebugJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 24.921 secs

/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: /Users/shprink/Sites/wordpress-hybrid-client/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/shprink/Sites/wordpress-hybrid-client/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
ERROR running one or more of the platforms: Error: /Users/shprink/Sites/wordpress-hybrid-client/platforms/android/cordova/run: Command failed with exit code 8
You may not have the required environment or OS to run this project

I'm also having the same problem.

Same here

Also having the same problem.

Oh, sorry, spoke too soon. I'm just using the standard Cordova CLI... sorry for the noise.

1+

+1

Was able to get mine to build, went with the first rule in tech- Reset It All!:

1) Remove all platforms (ios/android)
2) Remove all plugins from package.json (these have caused me issues in the past)
3) Remove platforms from package.json (looked like the "engine" section might have been stuck)
4) Ionic browser add crosswalk
5) Happy dance

Theory: plugins cause trouble, when in doubt, leave all your HTML/Css/Js alone, dump all plugins and platforms (anything that may cause trouble, facebook plugin, push plugin, etc) and rebuild. The migrations from the org.apache.cordova.device to cordova-plugin-device naming convention hasn't helped the situation at all. Progress is much needed, but the transitions aren't always smooth!

My platform, if it helps the Ionic crew at all:

Node Version: v0.12.0
Cordova CLI: 5.0.0
Ionic CLI Version: 1.4.0-alpha.6

@uofmmike Yep, you're onto something there. Resetting things seems to clear up some remnants that the Cordova CLI leaves behind.

I'd suggest @shprink you follow and let me know if that helps out.

reseting all did not help
[email protected]
crosswalk 18+

XWalkWebViewEngine.java:55: error: XWalkWebViewEngine is not abstract and does not override abstract method evaluateJavascript(String,ValueCallback<String>) in CordovaWebViewEngine
public class XWalkWebViewEngine implements CordovaWebViewEngine {

@soulman-is-good im having the same error

@jbavari jbavari was unassigned by soulman-is-good a day ago

WTF! how did that happen?

@kevin1992 still no luck in this?

I have the same problem, after i compare the package.json with working one, found that the plugin cordova-plugin-crosswalk-webview is at version 1.7.x, while working one uses version 2.2.0.

cordova plugin rm cordova-plugin-crosswalk-webview
cordova plugin add [email protected]

Then there is no problem of "ionic build android"

@caiyundong did solved the problem! )
Thank you a lot!

@caiyundong Thanks.

I removed plugin and added again. (in Ionic)
ionic plugin remove cordova-plugin-crosswalk-webview --save
ionic plugin add cordova-plugin-crosswalk-webview --save

@caiyundong Just to be a bit more precise change the version to latest

cordova plugin rm cordova-plugin-crosswalk-webview
cordova plugin add cordova-plugin-crosswalk-webview@latest
Was this page helpful?
0 / 5 - 0 ratings

Related issues

zoinkydoink picture zoinkydoink  路  3Comments

phyr0s picture phyr0s  路  3Comments

secret4info picture secret4info  路  3Comments

Tito1337 picture Tito1337  路  3Comments

patwaswapnil picture patwaswapnil  路  3Comments