Crosswalk Integration Beta in Ionic CLI (v1.3.2)

Anyone seeing or overcoming the following?

Anyone care to do a write up on integrating Crosswalk for those of us who develop on machines running Windows OS? I work for a large company and we are looking to build some of our in-house mobile solutions using ionic, with user-base spanning 4,000 to 5,000 and growing. We are very excited so far, but we find that the general support for windows devices, and windows development platform in general is lagging behind Macs and Linux. Case in point, we have yet to get our ionic apps to integrate Crosswalk, even after following the very straight-forward tutorials here. Most of the samples and other posts we have found elsewhere seems to lean towards Macs and Linux environmentsā€¦nothing on integrating on windows.

Any help would be much appreciated.

A node update to solved it for meā€¦

Iā€™m also using the facebook connect plugin, and I also encountered the same problem.
I wrote a before_platform_add hook script to remove the facebook plugin every time I reset android platform. (event hook seems to be available in >= ionic@1.3.2)

hooks/before_platform_add/uninstall_plugins.js:

#!/usr/bin/env node

/**
 * remove some of plugins before platform add.
 */
var exec = require('child_process').exec;
var sys = require('sys');
var plugins = [
  'org.crosswalk.engine',
  'com.phonegap.plugins.facebookconnect'
];

plugins.forEach(function(plugin) {
  exec('cordova plugin rm ' + plugin, function (error, stdout, stderr) {
    sys.puts(stdout);
  });
});

And my package.json is like this:

{
  "name": "myapp",
  "version": "1.0.0",
  "description": "",
  "dependencies": {
     // ...
  },
  "cordovaPlugins": [
    "./engine/cordova-crosswalk-engine-c0.6.1",
    "./local/phonegap-facebook-plugin --variable APP_ID=123456 --variable APP_NAME='My App'"
  ]
}

When I reset android platform, Iā€™m doing like this:

ionic browser rm crosswalk
ionic platform rm android
ionic platform add android
  # -> the `before_platform_add ` hook script removes the facebook plugin,
  # -> and then, the `after_platform_add` hook script adds `cordovaPlugins` defined in my `package.json`.
ionic browser add crosswalk

Same problems here for LocalNotification pluginā€¦
I managed to get rid of the AdMob problem by using https://github.com/floatinghotpot/cordova-admob-pro insteadā€¦ (same Author but more recently maintainedā€¦ afaic same functionality)

@xMarston
I managed to make the project build and run with LocalNotifications now also =)

Edited /platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java
and changed all the sendJavascript(js); calls to webView.sendJavascript(js);

And remove the private static void sendJavascript(final String js) function

No side-effects so far (apart from me using LocalNotification-8.0.0rc where .add() had changed name to .schedule())

My guess is that the pluginā€™s own sendJavascript() function has code that is unrelevant/deprecated when we run with Crosswalk webView.

I have the same issue.
have you fix it?

@zarko - are you still having that issue? Are you running Node v0.12?

Iā€™ve just released 1.3.10 of the CLI, and this should address some issues you all have been having.

For those still getting the EACCES error, please run ionic browser clean, then ionic browser add crosswalk.

@JayDee - I could help with this. Iā€™ve been testing the CLI on Windows 7, and havenā€™t run into too many problems. If you could point me in the directions of some issues you and your team has been having, I can help out.

As far as support for Windows Phones, it is still on our to-do list with no specified date of completion. Are you looking for Windows Phone support or just building with Ionic on Windows Platforms?

1 Like

Thanks, with this AdMob plugin works great and I can build the project but if I add the LocalNotification plugin and I replace and remove the things you indicated I get this error:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/app/NotificationCompat$Action;
	at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
	at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
	at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
	at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
	at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
	at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
	at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
	at com.android.dx.command.dexer.Main.run(Main.java:246)
	at com.android.dx.command.dexer.Main.main(Main.java:215)
	at com.android.dx.command.Main.main(Main.java:106)

Execution failed for task ':dexArmv7Debug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
  	/Users/xxxxxxx/Documents/adt-bundle-mac-x86_64-20140702/sdk/build-tools/21.1.2/dx --dex --no-optimize --output /Users/xxxxxx/Apps/Ionic14/LotoLuck/platforms/android/build/intermediates/dex/armv7/debug --input-list=/Users/xxxxx/Apps/xxxx/xxxx/platforms/android/build/intermediates/tmp/dex/armv7/debug/inputList.txt

I have an existing project that does not have Crosswalk installed yet. After I ran ionic browser add crosswalk and try to run the app, I get this error

Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').

Anyone run into something like this before? I know I have google play services installed, because I have been using it before I installed crosswalk.

I also add SDK build-tools 19.1 21 21.1.2. but when I build android,
the error info shows No installed build tools found. Please install the Android build tools version 19.1.0 or higher.

ionic #1.0.0-beta.14
when i add crosswalk and then I build android

Running command: /Users/raven/desktop/MicroSims-mobile/hooks/after_prepare/010_add_platform_class.js /Users/raven/desktop/MicroSims-mobile
add to body class: platform-android
Running command: /Users/raven/desktop/MicroSims-mobile/hooks/after_prepare/020_remove_sass_from_platforms.js /Users/raven/desktop/MicroSims-mobile
Running command: /Users/raven/desktop/MicroSims-mobile/platforms/android/cordova/build
ANDROID_HOME=/Users/raven/documents/android-sdk-macosx
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
Running: /Users/raven/desktop/MicroSims-mobile/platforms/android/gradlew cdvBuildDebug -b /Users/raven/desktop/MicroSims-mobile/platforms/android/build.gradle -Dorg.gradle.daemon=true

FAILURE: Build failed with an exception.

  • Where:
    Script ā€˜/Users/raven/Desktop/MicroSims-mobile/platforms/android/CordovaLib/cordova.gradleā€™ line: 64

  • What went wrong:
    A problem occurred evaluating root project ā€˜androidā€™.

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: 2.52 secs

/Users/raven/desktop/MicroSims-mobile/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/raven/desktop/MicroSims-mobile/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/raven/desktop/MicroSims-mobile/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/raven/desktop/MicroSims-mobile/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project

image

And Ionic Info
OS: Mac OS X Yosemite
Node Version: v0.12.0
Cordova CLI: 4.2.0
Ionic CLI Version: 1.3.9
Xcode version: Xcode 6.1.1 Build version 6A2008a
ios-sim version: 3.1.1

and ionic version in project 1.0.0-beta.14

@jbavari1
@mhartington

Hi guys,

Iā€™ve just started a new project from scratch with the latest Ionic CLI and Ionic beta 14 version and added Crosswalk like posted. I sadly encountered a strange flickering in using the keyboard with crosswalk.

Take a look at the demo videos:

Test device: Nexus 5 Android 5.0.1

Can you help me out how to fix this?

1 Like

This will be something weā€™d have to fix with the keyboard plugin

After I config android again. I can build android as well.
Then I want to build 3 kinds of apks (2 kinds of android<=4.3 and one kind of android>=4.4)
because itā€™s too large for user based android >=4.4.
what I do now is to build one and then remove android platform and build another one.
Is there an easy way?

Had the same issue and uninstalled Crosswalk. Splashscreen worked perfectly as expected. Hope they solve this soon.

Thanks @jbavari1, upgrading node to 0.10.33 fixed it, adding crosswalk worked perfect. Managed to build successfully after implementing @MaZZlyā€™s fix/workaround for projects that contain the Cordova LocalNotification plugin (thanks!).

As expected, the splash screen is now broken, but Iā€™ll be patiently waiting for a fix. :slight_smile:

I also had to make use of android:windowSoftInputMode, as indicated over at http://ionicframework.com/docs/api/page/keyboard/ to resolve some flickering issues that got significantly more pronounced with the crosswalk upgrade.

Info:
OS: Mac OS X Yosemite
Node Version: v0.10.33
Cordova CLI: 4.2.0
Ionic Version: 1.0.0-beta.14
Ionic CLI Version: 1.3.10
Xcode version: Xcode 6.1.1 Build version 6A2008a
ios-sim version: 3.0.0

@gx14 @semoju Try installing the splashscreen plugin from Github instead of the plugin registry:
cordova plugin add https://github.com/apache/cordova-plugin-splashscreen

Iā€™ve been told from the cordova team that the splashscreen plugin should be updated and pushed to the cordova plugin registry, however, itā€™s not been done yet.

Thanks @MaZZly for the work around.

@raven - try updating your JDK to 8. Iā€™ve heard that fixes that issue.

The addition of crosswalk went smoothly. In the process I updated cordova to 4.2.0. The app can be started and debugged.

But I am having issues with plugins. Is there any trick to getting the following plugins to work again?

  • com.phonegap.plugins.facebookconnect 0.11.0 ā€œFacebook Connectā€
  • org.apache.cordova.geolocation 0.3.11 ā€œGeolocationā€

OS: Mac OS X Yosemite
Node Version: v0.10.33
Cordova CLI: 4.2.0
Ionic Version: driftyco/ionic-bower#1.0.0-beta.14
Ionic CLI Version: 1.3.10
JDK: 1.8.0_25

Thanks!

@jbelis - i havenā€™t tried crosswalk with either of those plugins. Iā€™ll try to take a look.

For all the users having problems with the splashscreen, the new 1.0 version of org.apache.cordova.splashscreen is now on the cordova plugin registry. Please update the plugin and let me know if that fixes your issues.