Android Crosswalk Lite - Android Studio 集成 [英] Android Crosswalk Lite - Android Studio integration

查看:29
本文介绍了Android Crosswalk Lite - Android Studio 集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 Android Studio 项目中成功实现了 crosswalk 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/

熟悉实现 crosswalk 的人都知道应用大小增加了 +- 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 at https://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 文件有关.放置在每个可以想象的文件夹中(jars、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.

问我是否有人已经成功地让精简版在 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 集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆