Skip to content

Instantly share code, notes, and snippets.

@BodhiHu
Last active December 16, 2017 08:57
Show Gist options
  • Save BodhiHu/b74f6d03bf3d2fac4d40 to your computer and use it in GitHub Desktop.
Save BodhiHu/b74f6d03bf3d2fac4d40 to your computer and use it in GitHub Desktop.
(Meteor) Build With Crosswalk for Android

Build With Crosswalk for Android

Build

  • Build meteor:
meteor build .build --server "https://server/url"
  • Download the [crosswalk cordova package][1], rename the framework/ to CordovaLib, and copy it to override meteor build's CordovaLib.
  • Add VERSION file:
cp <path_to_unpacked_arm_bundle>/VERSION VERSION
  • Add permissons to manifest:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  • Clean the app:
cd .build/android/project
ant clean
android update project --subprojects --path . --target "android-21"
  • Build the CrossWalk:
cd CordovaLib/
android update project --subprojects --path . --target "android-21"
ant debug/release
  • Build app:
ant debug/release

If (errors)

  • To fix the compile errors:
cd CordovaLib
ant clean; ant debug/build;
ln -s bin ant-build

cd xwalk_core_library
ant clean; ant debug/build;
ln -s bin ant-build
  • To fix the "canGoBack" not found error: simply replace
webView.canGoBack()

with

webView.getNavigationHistory().canGoBack()

References

@adamgins
Copy link

Thanks for this.

I downloaded this Crosswalk build to my mac: https://download.01.org/crosswalk/releases/crosswalk/android/stable/latest/arm/crosswalk-cordova-14.43.343.17-arm.zip

My android update failed on the clean step:

Adams-MacBook-Pro:project adamginsburg$ ant clean
Buildfile: /Users/adamginsburg/Documents/Development/build-crosswalk/android/project/build.xml

-check-env:
 [checkenv] Android SDK Tools Revision 24.3.0
 [checkenv] Installed at /Users/adamginsburg/Documents/adt-bundle-mac-x86_64-20130219/sdk

-setup:
     [echo] Project Name: CordovaApp
  [gettype] Project Type: Application

-pre-clean:

clean:
[getlibpath] Library dependencies:
[getlibpath] 
[getlibpath] ------------------
[getlibpath] Ordered libraries:

nodeps:

-check-env:
 [checkenv] Android SDK Tools Revision 24.3.0
 [checkenv] Installed at /Users/adamginsburg/Documents/adt-bundle-mac-x86_64-20130219/sdk

-setup:
     [echo] Project Name: XWalkCoreLibrary
  [gettype] Project Type: Android Library

-pre-clean:

clean:

nodeps:

-check-env:
 [checkenv] Android SDK Tools Revision 24.3.0
 [checkenv] Installed at /Users/adamginsburg/Documents/adt-bundle-mac-x86_64-20130219/sdk

-setup:
     [echo] Project Name: Cordova
  [gettype] Project Type: Android Library

-pre-clean:

clean:

BUILD SUCCESSFUL
Total time: 0 seconds
Adams-MacBook-Pro:project adamginsburg$ android update project --subprojects --path . --target "android-21"
Updated project.properties
Updated local.properties
----------
build.xml: Failed to find version-tag string. File must be updated.
In order to not erase potential customizations, the file will not be automatically regenerated.
If no changes have been made to the file, delete it manually and run the command again.
If you have made customizations to the build process, the file must be manually updated.
It is recommended to:
        * Copy current file to a safe location.
        * Delete original file.
        * Run command again to generate a new file.
        * Port customizations to the new file, by looking at the new rules file
          located at <SDK>/tools/ant/build.xml
        * Update file to contain
              version-tag: custom
          to prevent file from being rewritten automatically by the SDK tools.
----------
Updated file ./proguard-project.txt
Updated project.properties
Updated local.properties
build.xml: Found version-tag: custom. File will not be updated.
Updated file ./CordovaLib/proguard-project.txt
Adams-MacBook-Pro:project adamginsburg$ 

Any help appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment