Thanks for trying Crosswalk.
You have two methods to build Crosswalk-cordova project by Gradle tools.
1, Build existing xwalk_core_library host in crosswalk-cordova.zip, you need
follow steps
a), add project dependence in rootProject/setting.gradle file
include ':CordovaLib:xwalk_core_library'
b), package the xwalk_core_library lib to apk, add below section to android
block in rootProject/build.gradle file.
task copyNativeLibs(type: Copy) {
def libPath =
project(':CordovaLib:xwalk_core_library').projectDir.absolutePath + '/libs'
println libPath
from fileTree(dir: 'libs', include: '*/*.so' ) into
'build/native-libs'
from fileTree(dir: libPath, include: '*/*.so' ) into
'build/native-libs'
}
tasks.withType(Compile) { compileTask -> compileTask.dependsOn
copyNativeLibs }
clean.dependsOn 'cleanCopyNativeLibs'
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask
->
pkgTask.jniFolders = new HashSet()
pkgTask.jniFolders.add(new File(projectDir, 'build/native-libs'))
println pkgTask.jniFolders
}
c), add compiled dependence in CordovaLib/build.gradle
dependencies {
compile project(':CordovaLib:xwalk_core_library')
}
2, the second method is using Crosswalk AAR instead of the hosted
xwalk_core_library in crosswalk-cordova.zip, it's too simple to use the AAR
library, please follow the steps:
a), add maven repo in rootPoject/build.gradle and CordovaLib/build.project
repositories {
maven {
url
'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
}
b), add compiled dependence in CordovaLib/build.gradle
dependencies {
compile 'org.xwalk:xwalk_core_library:10.39.235.15:x86@aar'
}
You can also specify arm instead of x86 to build arm version, and can build
multi-apk at the same time by not use the classifier. More information in
https://crosswalk-project.org/documentation/embedding_crosswalk/crosswalk_aar.html.
Thanks,
Junwei.
From: Crosswalk-help
[mailto:[email protected]] On Behalf Of
Victorio Chavarria
Sent: Thursday, March 19, 2015 12:47 PM
To: [email protected]
Subject: [Crosswalk-help] Issues migrating embedded Cordova app to X-Walk in
Android Studio
I have a working embedded Cordova app which was developed in Android Studio. We
are wanting to migrate the web view to use X-Walk. I found a guide at the link
below, but it looks to be written for Eclipse / Ant, while we're using Android
Studio / Gradle. I think as a result of this when I attempt to build the app in
Android Studio I get "package org.xwalk.core does not exist" errors from the
Cordova portion of the build. I'm guessing the problem is that the
CordovaLib/xwalk_core_library has no build.gradle file. I'm also suspicious of
the build file in the CordovaLib dir.
Has anyone gotten this work? If so, could you share your code or at least the
Gradle build files?
https://crosswalk-project.org/documentation/cordova/migrate_an_application.html
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help