问题描述
我已经在Android Studio项目中成功实现了人行横道Webview项目.基本上通过以下链接: https://diego.org/2015/01/07 /embedding-crosswalk-in-android-studio/
I have successfully implemented crosswalk webview project inside an Android studio project. Basically by following this link: https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/
熟悉人行横道的人们知道,应用程序的大小会增加+-20-30 mb.因此,我一直在尝试集成人行横道的精简版.这是+-10 mb,很遗憾没有成功.
People familiar with implementing crosswalk know that the app size gets increased by +- 20-30 mb.For this reason i have been trying to integrate the lite version of crosswalk. Which is +- 10 mb, Unfortunaly without success.
正常的人行横道项目有一个Maven版本,可从以下位置获得 https://download.01.org/crosswalk/releases/crosswalk/android /maven2/org/xwalk/xwalk_core_library/
the normal crosswalk project has a maven version available athttps://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/
该lite版本在 https://download.01.org上也具有AAR版本. /crosswalk/releases/crosswalk-lite/android/canary/但是没有POM文件,我无法在Android Studio中使用它.
the lite version has a also AAR edition at https://download.01.org/crosswalk/releases/crosswalk-lite/android/canary/but there is no POM file and i cannot use it inside Android Studio.
现在,我一直在尝试手动下载人行横道精简版.我创建了一个库项目,复制了所有相关文件,创建了gradle文件,并将其包含在一个小型测试应用程序中.到目前为止,一切似乎都还不错.应用程序编译. XWalkView之类的所有类都可以在我的应用程序中找到.运行该应用程序也可以正常运行,只是Webview完全是黑色的.
Now i have been trying to manually download the crosswalk-lite version. I created a library project, copied all the relevant files, created the gradle files and included it inside a small test application. and so far everything seems to be alright. App compiles. all classes like XWalkView are available inside my app. Running the app works as well, except that the webview is completely black.
现在,我认为它与libxwalkcore.so文件有关,该文件没有以某种方式加载.放置在每个可以想象的文件夹(jar,jniLibs,lib等)中.不起作用.任何日志中都没有错误.
Now i think it got something to do with the libxwalkcore.so file which does not gets loaded somehow. Placed in every imaginable folder (jars, jniLibs, lib etc). doesnt work. no errors in any log.
问题我是否有人已经成功使lite版本在android studio项目中工作.
Question i have if someone already succeeded in getting the lite version working inside a android studio project.
顺便说一句.crosswalk-lite库应用程序的gradle文件包含:
btw.the gradle file of the crosswalk-lite library app contains:
dependencies {
compile files('libs/xwalk_core_library_java_library_part.jar')
compile files('libs/xwalk_core_library_java_app_part.jar')
}
推荐答案
我遇到了同样的问题,这就是我的解决方法.
I had the same issue, this is how I resolved.
我遵循了相同的教程,使用此存储库和依赖项.
I followed the same tutorial, use this repository and dependency instead.
repositories {
maven {
url 'https://download.01.org/crosswalk/releases/crosswalk-lite/android/maven2/'
}
}
依赖性
compile 'org.xwalk:xwalk_core_library_canary:17.46.460.1'
这样更改您的MainActivity.java
public class MainActivity extends XWalkActivity {
XWalkView mXWalkView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void initXWalkView() {
mXWalkView = (XWalkView) findViewById(R.id.activity_main);
mXWalkView.load("file:///android_asset/index-mobile.html", null);
}
@Override
protected void onXWalkReady() {
initXWalkView();
}
}
此处,以获取更多信息.
这篇关于Android Crosswalk Lite-Android Studio集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!