Crosswalk Integration Beta in Ionic CLI (v1.3.2)

#1

The Ionic CLI has Crosswalk integration and we need some testers!

##Current Version of the CLI 1.3.2

Installing the CLI

$ npm install -g ionic
# or if your on osx
$ sudo npm install -g ionic

Note, you must have the necessary tools to build and android project

Installing the Crosswalk Runtime
Create an ionic project and add the android platform

$ ionic start tmp && cd tmp
$ ionic platform add android

Install the Crosswalk runtime for the project

$ ionic browser add crosswalk

This will do a few things.

  • Fetch the Crosswalk runtime
  • Convert the Android-Cordova project to use the Gradle Build System
  • Build your project.

Removing Crosswalk
Crosswalk can removed two ways.

$ ionic browser revert android
# or
$ ionic browser remove crosswalk

Minimum Android SDK Version Needed - 19
Make sure you have the build tools for Android API level 19.
To install them:

  • Run android from the command line
$ android
# this will bring up the Android SDK Manager up. 
  • Select Android SDK Build Tools for API level 19, and install.

Multiple APKS
To build separate APKs for x86 and arm7, use this command.

MUILD_MULTIPLE_APKS=true ionic run android

This will split out 2 binaries, one for x86 and one for arm7.

Please update your CLI.

FAQs

  • My plugin is throwing a bunch of errors and is no longer working.
  • The chromium webview requires Cordova-Android 4.0, which is still in beta
    While it is fairly stable, some APIs have change internally. Plugin managers
    need to update their plugins when 4.0 is released.

##Whats next?
What we’re working on for the next cli update.

  • Beta/Canary builds of Crosswalk
  • Building post 4.4. without Crosswalk

Cheers. :beers:

36 Likes
Problem integrating crosswalk
Navbar linear gradient and button backgrounds
[bug] Beta 14 Nav Button Alignment
Add crosswalk to existing project does not enable gradle build
Sidemenu with slidebox
Ionic build android after last update
pinned globally #2
#3

Do we still need to specify the older version of Cordova for android, i.e.

ionic add platform android@3.5

as per the current way to build crosswalk, or does Crosswalk now support Cordova 4.x ?

#4

Crosswalk for cordova will work for 4. We’ve wrapped everything under the hood to make sure you have the right version of android.

So even if you do

$ ionic add platform android@3.5

The CLI will check what cordova-android version you have, and then update it to 4.0.

3 Likes
#5

That’s great news! Congrats guys!

#6

Will this bundle both run-times?

#7

Right now, yes.
We are working on separate builds.

#8

@nicraboy - we’re using a Cordova Android 4.0.x fork, and as such it uses the BUILD_MULTIPLE_APKS for x86 and ARM by default to build two separate run times. Both runtimes should be downloaded individually.

#9

Yes yes yes!!! This is great news. Thanks guys!!

#10

Does this mean it will produce two APK files to submit to Google Play by default?

#11

When i run ionic run android after adding crosswalk first launch was successful but then i rebuild my cordova project and when i try to run ionic run android again i get this error:

C:\wamp\www\WeAlert\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
ERROR: Failed to launch application on device: ERROR: Failed to install apk to d
evice:  pkg: /data/local/tmp/CordovaApp-debug.apk


Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

i’ve tried reverting the crosswalk browser but still get this error when i try running on my android device again
Had to remove the app from my phone before i could launch my app again

#12

@sjerd, the message you are receiving just informs you that it will not install the new APK because its version is older than the one you already have installed on your device. Just change your app version in config.xml to something higher that your previous version and it will be installed fine.

#13

After installing crosswalk via ionic CLI. Splashscreen is no longer showing, just a white screen before the app is loaded

2 Likes
#14

I simply followed the tutorial but when doing: ionic build android … I’m getting the following …

:processDebugManifestC:\apache24\htdocs\ionic\net_notes\platforms\android\AndroidManifest.xml:33:13 Error:
Missing one of the key attributes ‘action#name,category#name’ on element intent-filter at AndroidManifest.xml:33:13
FAILED
C:\apache24\htdocs\ionic\net_notes\platforms\android\AndroidManifest.xml:0:0 Error:
Validation failed, exiting

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:processDebugManifest’.

Manifest merger failed with multiple errors, see logs

  • 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: 4.802 secs

c:\apache24\htdocs\ionic\net_notes\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s,/c,c:\apache24\htdocs\ionic\net_notes\platforms\android\gradlew,assembleDebug,-b,c:\apache24\htdocs\ionic\net_notes\platforms\android\build.gradle,-Dorg.gradle.daemon=true
Error: c:\apache24\htdocs\ionic\net_notes\platforms\android\cordova\build.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\David Marko\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

#15

Yes, crosswalk make the job and application runs properly even on S2.

I found at least 2 issues with Crosswalk:

  • apk size +23M
  • somtimes I get Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1)..... Application just force closes and during 3 month I use Crosswalk I still didn’t find solution.
    `
#16

Searched all over the internet, but cannot find a fix for the splashscreen not showing at all. Please let me know if anyone has a solution. thank you

1 Like
#17

‘ionic browser add crosswalk’ completes successfully but ‘ionic build android’ fails with errors as shown below:

AILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘android’.
    Could not resolve all dependencies for configuration ‘:classpath’.
    Could not download artifact 'gradle.jar (com.android.tools.build:gradle:1.0.0)'
    Could not GET ‘https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.jar’.
    The target server failed to respond

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

BUILD FAILED

Please what did I miss? Thanks

#18

Worked on another try - guess it was my internet! Thanks.
Next up should be separating the builds - arm and x86. Well done guys!

#19

I’m not sure if this is related to this topic, but I tried to build an application after installing Ionic and Crosswalk and got this error:

FAILURE: Build failed with an exception.

* Where:
Script '/Users/fbalestr/src/ionic-test/platforms/android/cordova.gradle' line: 59

* What went wrong:
A problem occurred evaluating script.
> No installed build tools found. Please install the Android build tools version 19.1.0 or higher.

* 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: 3.622 secs

/Users/fbalestr/src/ionic-test/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: /Users/fbalestr/src/ionic-test/platforms/android/gradlew with args: assembleDebug,-b,/Users/fbalestr/src/ionic-test/platforms/android/build.gradle,-Dorg.gradle.daemon=true
Error: /Users/fbalestr/src/ionic-test/platforms/android/cordova/run: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

I had Android build-tools version 20, which appeared in my build-tools folder as “android-4.4W”, it seems they were not recognised as a valid build tools version. The error went away when I installed build tools 19.1. All this on OS X.

#20

Can confirm this, thanks for pointing this out.
Looking into this now.