带cordova的人行横道 [英] Crosswalk-lite with cordova
问题描述
我花了几天时间试图让我的应用程序嵌入crosswalk-lite,而不是正常的人行横道。
最终我可以做到了!
首先,为什么它总是去下载正常的二进制文件的原因是,crosswalk-lite不是正式发布,但我没有问题,我的应用程序,所以这里我们去:
Go
替换
repositories {
maven {
url'https ://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
}
为
repositories {
mavenLocal()
}
然后在cdvPluginPostBuildExtras.add({:
def liteSpec =org。 xwalk:xwalk_core_library:1.0.0.1
并编辑依赖规则为
dependencies {
compile liteSpec
}
记住1.0.0.1是我们自创版本
现在下载从crosswalk-lite存储库您要嵌入的版本,我已经测试与版本17.46.451.1,下载只是.aar文件。
这个版本有x86和armv7资源,所以你必须解压缩.aar(实际上是一个zip文件),然后删除文件
res / raw /libxwalkcore.so.x86 [如果你想为armv7设备制作apk]
res / raw / libxwalkcore.so.armeabi_v7a [如果你想制作apk for x86设备]
这是因为它会触发错误重复的资源,我注意到。
没有资源的文件夹,并将其重命名为.aar
最后的魔法触摸,(如果你还没有安装maven做apt-get install maven2)
mvn install:install-file -Dfile = * YOURFILE * .aar -DgroupId = org.xwalk -DartifactId = xwalk_core_library -Dversion = 1.0.0.1 -Dpackaging = aar
现在你可以使用crosswalk-lite插件构建你的应用程序,
它可能似乎很难,它不是,它值得每mb保存到apk
I am spending days trying to make my app embedded with crosswalk-lite instead the normal crosswalk. Can anyone that have done it explain the method?
FINALLY I MADE IT !!
First of all the reason why it always goes to download the normal binaries is that the crosswalk-lite is not in official release, but i had no problems with my app so here we go: Go to your project folder than edit this file:
platforms/android/cordova-plugin-crosswalk-webview/yourapp-xwalk.gradle
replace
repositories {
maven {
url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
}
to be
repositories {
mavenLocal()
}
then add near the line 71 after cdvPluginPostBuildExtras.add({:
def liteSpec = "org.xwalk:xwalk_core_library:1.0.0.1"
and edit the dependecies rule to be
dependencies {
compile liteSpec
}
remember that 1.0.0.1 is our self created version
Now download from the crosswalk-lite repository the version you want to embed, i have tested with the version 17.46.451.1 , download just the .aar file. This version has both x86 and armv7 reources so you have to unzip the .aar (is actually a zip file ) and then delete the file
res/raw/libxwalkcore.so.x86 [ if you want to make apk for armv7 devices ]
res/raw/libxwalkcore.so.armeabi_v7a [ if you want to make apk for x86 devices ]
this is because it will trigger the error duplicate resources, as i noticed.
Now zip again the folder without the resource and rename it to .aar
And finally the magic touch, (if you haven't installed maven do apt-get install maven2)
mvn install:install-file -Dfile=*YOURFILE*.aar -DgroupId=org.xwalk -DartifactId=xwalk_core_library -Dversion=1.0.0.1 -Dpackaging=aar
Now you can build your app with the crosswalk-lite embbeded, it may seems difficult but it's not , and it worth every mb saved to the apk
这篇关于带cordova的人行横道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!