Build error after adding Crosswalk plugin to a Cordova Android project
Asked Answered
Z

4

11

I'm using the latest cordova android (5.1.0). The project is building and running fine without crosswalk, but after I add the crosswalk plugin using

cordova plugin add https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.git

I get the following build error:

Error:15:53:54.127 [ERROR] [system.err] /Users/or/Projects/Test/cordova/platforms/android/src/org/crosswalk/engine/    XWalkWebViewEngine.  java:48: error: cannot find symbol
  15:53:54.127 [ERROR] [system.err] import org.xwalk.core.XWalkGetBitmapCallback;
  15:53:54.128 [ERROR] [system.err]                      ^
  15:53:54.128 [ERROR] [system.err]   symbol:   class XWalkGetBitmapCallback
  15:53:54.128 [ERROR] [system.err]   location: package org.xwalk.core
  15:53:54.178 [ERROR] [system.err] /Users/or/Projects/Test/cordova/platforms/android/src/org/crosswalk/engine/XWalkWebViewEngine.      java:103: error: cannot find symbol
  15:53:54.179 [ERROR] [system.err]                                     new XWalkGetBitmapCallback() {
  15:53:54.179 [ERROR] [system.err]                                         ^
  15:53:54.180 [ERROR] [system.err]   symbol: class XWalkGetBitmapCallback
  15:53:54.181 [ERROR] [system.err] /Users/or/Projects/Test/cordova/platforms/android/src/org/crosswalk/engine/XWalkWebViewEngine.      java:207: error: cannot find symbol
  15:53:54.182 [ERROR] [system.err]             webView.getExtensionManager().loadExtension(XWALK_EXTENSIONS_FOLDER + File.separator     +   path);
  15:53:54.182 [ERROR] [system.err]                    ^
  15:53:54.182 [ERROR] [system.err]   symbol:   method getExtensionManager()
  15:53:54.182 [ERROR] [system.err]   location: variable webView of type XWalkCordovaView
  15:53:54.184 [ERROR] [system.err] /Users/or/Projects/Test/cordova/platforms/android/src/org/crosswalk/engine/XWalkCordovaView.    java:93:   error: method does not override or implement a method from a supertype
  15:53:54.185 [ERROR] [system.err]     @Override
  15:53:54.185 [ERROR] [system.err]     ^
  15:53:54.188 [ERROR] [system.err] Note: Some input files use or override a deprecated API.
  15:53:54.188 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details.
  15:53:54.188 [ERROR] [system.err] 4 errors
  15:53:54.190 [ERROR] [org.gradle.BuildExceptionReporter] 
  15:53:54.190 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
  15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] 
  15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
  15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':compileX86DebugJavaWithJavac'.
  15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] > Compilation failed; see the compiler error output for details.
  15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] 
  15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
  15:53:54.192 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 

The project is built using Android Studio.

Has someone come across anything similar?

Thanks

Zebulen answered 28/1, 2016 at 14:9 Comment(0)
F
16

try this it's working for me.

You must add the plugin before adding the android platform.

cordova -version ==> 5.1.1
  1. Navigate to the project directory

    cd cordova/

  2. Remove the android platform

    cordova platform rm android

  3. Check the crosswalk plugin is not installed

    cordova plugin ls

  4. Add the crosswalk plugin with npm

    cordova plugin add cordova-plugin-crosswalk-webview

  5. Add the android platform

    cordova platform add android

  6. Build the android project

    cordova build android

  7. Run android project

    cordova run android

Flashing answered 28/1, 2016 at 17:15 Comment(0)
R
50

If using Ionic (not sure if another platform of framework does the same), the root config.xml template includes the following reference:

<preference name="xwalkVersion" value="17+" />

By removing it and firing a

cordova build android 

(and also following @badboyunited 's answer) causes the plugin to be downloaded with the latest version.

Rickard answered 6/5, 2016 at 20:37 Comment(0)
F
16

try this it's working for me.

You must add the plugin before adding the android platform.

cordova -version ==> 5.1.1
  1. Navigate to the project directory

    cd cordova/

  2. Remove the android platform

    cordova platform rm android

  3. Check the crosswalk plugin is not installed

    cordova plugin ls

  4. Add the crosswalk plugin with npm

    cordova plugin add cordova-plugin-crosswalk-webview

  5. Add the android platform

    cordova platform add android

  6. Build the android project

    cordova build android

  7. Run android project

    cordova run android

Flashing answered 28/1, 2016 at 17:15 Comment(0)
G
0

I was having issues after installing Crosswalk, and I found a solution that worked for me here: https://crosswalk-project.org/jira/si/jira.issueviews:issue-html/XWALK-5965/XWALK-5965.html

tl;dr: install the "Android support libraries" from the extras repository (from the Android SDK manager)

Georgie answered 27/9, 2016 at 8:56 Comment(0)
T
-2

Change xwalkVersion preference to 18+

https://crosswalk-project.org/jira/browse/XWALK-7043

Thorman answered 11/2, 2017 at 18:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.