- How do I play audio with different playback rates?
- Why are Intel XDK Android Crosswalk build files so large?
- Why is the size of my installed app much larger than the apk for a Crosswalk application?
- Why does my Android Crosswalk build fail with the com.google.playservices plugin?
- Why does my app fail to run on some devices?
- How do I stop "pull to refresh" from resetting and restarting my Crosswalk app?
- Which versions of Crosswalk are supported and why do you not support version X, Y or Z?
- How do I prevent my Crosswalk app from auto-completing passwords?
- How can I improve the performance of my Construct2 game built with Crosswalk?
- Why does the Google store refuse to publish my Crosswalk app?
- Why is my Crosswalk app generating errno 12 Out of memory errors on some devices?
- Construct2 Tutorial: How to use AdMob and IAP plugins with Crosswalk and the Intel XDK.
- What is the correct "Target Android API" value that I should use when building for Crosswalk on Android?
- Can I build my app with a version of Crosswalk that is not listed in the Intel XDK Build Settings UI?
- My Construct2 Crosswalk app flashes a white box or white band after the splash screen.
How do I play audio with different playback rates?
Here is a code snippet that allows you to specify playback rate:
var myAudio = new Audio('/path/to/audio.mp3'); myAudio.play(); myAudio.playbackRate = 1.5;
Why are Intel XDK Android Crosswalk build files so large?
When your app is built with Crosswalk it will be a minimum of 15-18MB in size because it includes a complete web browser (the Crosswalk runtime or webview) for rendering your app instead of the built-in webview on the device. Despite the additional size, this is the preferred solution for Android, because the built-in webviews on the majority of Android devices are inconsistent and poorly performing.
See these articles for more information:
Why is the size of my installed app much larger than the apk for a Crosswalk application?
This is because the apk is a compressed image, so when installed it occupies more space due to being decompressed. Also, when your Crosswalk app starts running on your device it will create some data files for caching purposes which will increase the installed size of the application.
Why does my Android Crosswalk build fail with the com.google.playservices plugin?
The Intel XDK Crosswalk build system used with CLI 4.1.2 Crosswalk builds does not support the library project format that was introduced in the "com.google.playservices@21.0.0" plugin. Use "com.google.playservices@19.0.0" instead.
Why does my app fail to run on some devices?
There are some Android devices in which the GPU hardware/software subsystem does not work properly. This is typically due to poor design or improper validation by the manufacturer of that Android device. Your problem Android device probably falls under this category.
How do I stop "pull to refresh" from resetting and restarting my Crosswalk app?
See the code posted in this forum thread for a solution: /en-us/forums/topic/557191#comment-1827376.
An alternate solution is to add the following lines to your intelxdk.config.additions.xml
file:
<!-- disable reset on vertical swipe down --><intelxdk:crosswalk xwalk-command-line="--disable-pull-to-refresh-effect" />
Which versions of Crosswalk are supported and why do you not support version X, Y or Z?
The specific versions of Crosswalk that are offered via the Intel XDK are based on what the Crosswalk project releases and the timing of those releases relative to Intel XDK build system updates. This is one of the reasons you do not see every version of Crosswalk supported by our Android-Crosswalk build system.
With the September, 2015 release of the Intel XDK, the method used to build embedded Android-Crosswalk versions changed to the "pluggable" webview Cordova build system. This new build system was implemented with the help of the Cordova project and became available with their release of the Android Cordova 4.0 framework (coincident with their Cordova CLI 5 release). With this change to the Android Cordova framework and the Cordova CLI build system, we can now more quickly adapt to new version releases of the Crosswalk project. Support for previous Crosswalk releases required updating a special build system that was forked from the Cordova Android project. This new "pluggable" webview build system means that the build system can now use the standard Cordova build system, because it now includes the Crosswalk library as a "pluggable" component.
The "old" method of building Android-Crosswalk APKs relied on a "forked" version of the Cordova Android framework, and is based on the Cordova Android 3.6.3 framework and is used when you select CLI 4.1.2 in the Project tab's build settings page. Only Crosswalk versions 7, 10, 11, 12 and 14 are supported by the Intel XDK when using this build setting.
Selecting CLI 5.1.1 in the build settings will generate a "pluggable" webview built app. A "pluggable" webview app (built with CLI 5.1.1) results in an app built with the Cordova Android 4.1.0 framework. As of the latest update to this FAQ, the CLI 5.1.1 build system supported Crosswalk 15. Future releases of the Intel XDK and the build system will support higher versions of Crosswalk and the Cordova Android framework.
In both cases, above, the net result (when performing an "embedded" build) will be two processor architecture-specific APKs: one for use on an x86 device and one for use on an ARM device. The version codes of those APKs are modified to insure that both can be uploaded to the Android store under the same app name, insuring that the appropriate APK is automatically delivered to the matching device (i.e., the x86 APK is delivered to Intel-based Android devices and the ARM APK is delivered to ARM-based Android devices).
For more information regarding Crosswalk and the Intel XDK, please review these documents:
- Intel XDK Crosswalk Chapter
- Using the Crosswalk for Android Build Option
- Choosing Crosswalk* Build Options: Shared or Embedded
How do I prevent my Crosswalk app from auto-completing passwords?
Use the Ionic Keyboard plugin and set the spellcheck attribute to false.
How can I improve the performance of my Construct2 game build with Crosswalk?
Beginning with the Intel XDK CLI 5.1.1 build system you must add the --ignore-gpu-blacklist
option to your intelxdk.config.additions.xml
file if you want the additional performance this option provides to blacklisted devices. See this forum post for additional details.
If you are a Construct2 game developer, please read this blog by another Construct2 game developer regarding how to properly configure your game for proper Crosswalk performance > How to build optimized Intel XDK Crosswalk app properly?<
Also, you can experiment with the CrosswalkAnimatable option in your intelxdk.config.additions.xml
file (details regarding the CrosswalkAnimatable option are available in this Crosswalk Project wiki post: Android SurfaceView vs TextureView).
<!-- Controls configuration of Crosswalk-Android "SurfaceView" or "TextureView" --><!-- Default is SurfaceView if >= CW15 and TextureView if <= CW14 --><!-- Option can only be used with Intel XDK CLI5+ build systems --><!-- SurfaceView is preferred, TextureView should only be used in special cases --><!-- Enable Crosswalk-Android TextureView by setting this option to true --><preference name="CrosswalkAnimatable" value="false" />
See Chromium Command-Line Options for Crosswalk Builds with the Intel XDK for some additional tools that can be used to modify the Crosswalk's webview runtime parameters, especially the --ignore-gpu-blacklist
option.
Why does the Google store refuse to publish my Crosswalk app?
For full details, please read Android and Crosswalk Cordova Version Code Issues. For a summary, read this FAQ.
There is a change to the version code handling by the Crosswalk and Android build systems based on Cordova CLI 5.0 and later. This change was implemented by the Apache Cordova project. This new version of Cordova CLI automatically modifies the android:versionCode when building for Crosswalk and Android. Because our CLI 5.1.1 build system is now more compatible with standard Cordova CLI, this change results in a discrepancy in the way your android:versionCode is handled when building for Crosswalk (15) or Android with CLI 5.1.1 when compared to building with CLI 4.1.2.
If you have never published an app to an Android store this change will have little or no impact on you. This change might affect attempts to side-load an app onto a device, in which case the simplest solution is to uninstall the previously side-loaded app before installing the new app.
Here's what Cordova CLI 5.1.1 (Cordova-Android 4.x) is doing with the android:versionCode number (which you specify in the App Version Code field within the Build Settings section of the Projects tab):
Cordova-Android 4.x (Intel XDK CLI 5.1.1 for Crosswalk or Android builds) does this:
- multiplies your android:versionCode by 10
then, if you are doing a Crosswalk (15) build:
- adds 2 to the android:versionCode for ARM builds
- adds 4 to the android:versionCode for x86 builds
otherwise, if you are performing a standard Android build (non-Crosswalk):
- adds 0 to the android:versionCode if the Minimum Android API is < 14
- adds 8 to the android:versionCode if the Minimum Android API is 14-19
- adds 9 to the android:versionCode if the Minimum Android API is > 19 (i.e., >= 20)
If you HAVE PUBLISHED a Crosswalk app to an Android store this change may impact your ability to publish a newer version of your app! In that case, if you are building for Crosswalk, add 6000 (six with three zeroes) to your existing App Version Code field in the Crosswalk Build Settings section of the Projects tab. If you have only published standard Android apps in the past and are still publishing only standard Android apps you should not have to make any changes to the App Version Code field in the Android Builds Settings section of the Projects tab.
The workaround described above only applies to Crosswalk CLI 5.1.1 and later builds!
When you build a Crosswalk app with CLI 4.1.2 (which uses Cordova-Android 3.6) you will get the old Intel XDK behavior where: 60000 and 20000 (six with four zeros and two with four zeroes) are added to the android:versionCode for Crosswalk builds and no change is made to the android:versionCode for standard Android builds.
NOTE:
- Android API 14 corresponds to Android 4.0
- Android API 19 corresponds to Android 4.4
- Android API 20 corresponds to Android 5.0
- CLI 5.1.1 (Cordova-Android 4.x) does not allow building for Android 2.x or Android 3.x
Why is my Crosswalk app generating errno 12 Out of memory errors on some devices?
If you are using the WebGL 2D canvas APIs and your app crashes on some devices because you added the --ignore-gpu-blacklist flag to your intelxdk.config.additions.xml file, you may need to also add the --disable-accelerated-2d-canvas flag. Using the --ignore-gpu-blacklist flag enables the use of the GPU in some problem devices, but can then result in problems with some GPUs that are not blacklisted. The --disable-accelerated-2d-canvas flag allows those non-blacklisted devices to operate properly in the presence of WebGL 2D canvas APIs and the --ignore-gpu-blacklist flag.
You likely have this problem if your app crashes after running a few seconds with the an error like the following:
<gsl_ldd_control:364>: ioctl fd 46 code 0xc00c092f (IOCTL_KGSL_GPMEM_ALLOC) failed: errno 12 Out of memory <ioctl_kgsl_sharedmem_alloc:1176>: ioctl_kgsl_sharedmem_alloc: FATAL ERROR : (null).
See Chromium Command-Line Options for Crosswalk Builds with the Intel XDK for additional info regarding the --ignore-gpu-blacklist flag and other Chromium option flags.
Construct2 Tutorial: How to use AdMob and IAP plugins with Crosswalk and the Intel XDK.
See this tutorial on the Scirra tutorials site > How to use AdMob and IAP official plugins on Android-Crosswalk/XDK < written by Construct2 developer Kyatric.
Also, see this blog written by a Construct2 game developer regarding how to build a Construct2 app using the Appodeal ad plugin with your Construct2 app and the Intel XDK > How to fix the build error with Intel XDK and Appodeal? <.
What is the correct "Target Android API" value that I should use when building for Crosswalk on Android?
The "Target Android API" value (aka android-targetSdkVersion), found in the Build Settings section of the Projects tab, is the version of Android that your app and the libraries associated with your app are tested against, it DOES NOT represent the maximum level of Android onto which you can install and run your app. When building a Crosswalk app you should set to this value to that value recommend by the Crosswalk project.
The recommended "Target Android API" levels for Crosswalk on Android apps are:
- 18 for Crosswalk 1 thru Crosswalk 4
- 19 for Crosswalk 5 thru Crosswalk 10
- 21 for Crosswalk 11 thru Crosswalk 18
As of release 3088 of the Intel XDK, the recommended value for your android-targetSdkVersion is 21. In previous versions of the Intel XDK the recommended value was 19. If you have it set to a higher number (such as 23), we recommend that you change your setting to 21.
Can I build my app with a version of Crosswalk that is not listed in the Intel XDK Build Settings UI?
As of release 3088 of the Intel XDK, it is possible to build your Crosswalk for Android app using versions of the Crosswalk library that are not listed in the Project tab's Build Settings section. You can override the value that is selected in the Build Settings UI by adding a line to the intelxdk.config.additions.xml file.
NOTE: The process described below is for experts only! By using this process you are effectively disabling the Crosswalk version that is selected in the Build Settings UI and you are overriding the version of Crosswalk that will be used when you build a custom debug module with the Debug tab.
When building a Crosswalk for Android application, with CLI 5.x and higher, the Cordova Crosswalk Webview Plugin is used to facilitate adding the Crosswalk webview library to the build package (the APK). That plugin effectively "includes" the specified Crosswalk library when the app is built. The version of the Crosswalk library selected in the Build Settings UI is effected by a line in the Android build config file, similar to the following:
<intelxdk:crosswalk version="16"/>
The line above is added automatically to the intelxdk.config.android.xml file by the Intel XDK. If you attempt to change lines in the Android build config file they will be overwritten by the Intel XDK each time you use the Build tab (perform a build) or the Test tab. In order to modify (or override) this line in the Android config file you need to add a line to the intelxdk.config.additions.xml file.
The precise line you include in the intelxdk.config.additions.xml file depends on the version of the Crosswalk library you want to include.
<!-- Set the Crosswalk embedded library to something other than those listed in the UI. --><!-- In practice use only one, multiple examples are shown for illustration. --><preference name="xwalkVersion" value="17+"/><preference name="xwalkVersion" value="14.43.343.24" /><preference name="xwalkVersion" value="org.xwalk:xwalk_core_library_beta:18+"/>
The first example line in the code snippet above asks the Intel XDK to build with the "last" or "latest" version of the Crosswalk 17 release library (the '+' character means "last available" for the specified version). The second example requests an explicit version of Crosswalk 14 when building the app (e.g., version 14.43.343.24). The third example shows how to request the "latest" version of Crosswalk 18 from the Crosswalk beta Maven repository.
NOTE: only one such "xwalkVersion" preference tag should be used. If you include more than one "xwalkVersion" only the last one specified in the intelxdk.config.additions.xml file will be used.
The specific versions of Crosswalk that you can use can be determined by reviewing the Crosswalk Maven repositories: one for released Crosswalk libraries and one for beta versions of the Crosswalk library.
Not all Crosswalk libraries are guaranteed to work with your built app, especially the beta versions of the Crosswalk library. There may be library dependencies on the specific version of the Cordova Crosswalk Webview Plugin or the Cordova-Android framework. If a library does not work, select a different version.
Detailed instructions on the preference tag being used here are available in the Crosswalk Webview Plugin README.md documentation.
If you are curious when a specific version of Chromium will be supported by Crosswalk, please see the Crosswalk Release Dates wiki published by the Crosswalk Project.
My Construct2 Crosswalk app flashes a white box or white band after the splash screen.
The white box or white bands you see between the ending of the splash screen and the beginning of your app appears to be due to some webview initialization. It also appears in non-Crosswalk apps on Android, but does not show up as white. The white band that does appear can cause an initial "100% image" to bounce up and down momentarily. This issue is not being caused by the splash screen plugin or the Intel XDK; it appears to be interference caused by the Cordova webview initialization.
The following solution appears to work, although there may be some situations that it does not help. As this problem is better understood more information will be provided in this FAQ.
Add the following lines to your intelxdk.config.additions.xml file:
<platform name="android"><!-- set Crosswalk default background color --><!-- see http://developer.android.com/reference/android/graphics/Color.html --><preference name="BackgroundColor" value="0x00000000" /></platform>
The value 0x00000000 configures the webview background color to be "transparent black," according to the Cordova documentation and the Crosswalk webview plugin code. You should be able to set that color to anything you want. However, this color appears to work the best.
You may also want to add the following to your intelxdk.config.additions.xml file:
<platform name="android"><!-- following requires the splash screen plugin --><!-- see https://github.com/apache/cordova-plugin-splashscreen for details --><preference name="SplashScreen" value="screen" /><preference name="AutoHideSplashScreen" value="false" /><!-- <preference name="SplashScreenDelay" value="30000" /> --><preference name="FadeSplashScreen" value="false"/><!-- <preference name="FadeSplashScreenDuration" value="3000"/> --><preference name="ShowSplashScreenSpinner" value="false"/><preference name="SplashMaintainAspectRatio" value="false" /><preference name="SplashShowOnlyFirstTime" value="false" /></platform>
Testing of this fix was done with Crosswalk 17 on an Android 4.4, Android 5.0 and an Android 6.0 device.