Crosswalk Xwalk Webview 冲突 CollapsingToolbarLayout<android.support.design.widget>

Crosswalk Xwalk Webview conflict CollapsingToolbarLayout<android.support.design.widget>

我的项目有 折叠工具栏布局 实现 UI 效果

当我添加

编译'org.xwalk:xwalk_core_library:20.50.533.12'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    compile 'com.android.support:cardview-v7:23.2.1'
    compile 'com.android.support:recyclerview-v7:23.2.1'  
    compile 'org.xwalk:xwalk_core_library:20.50.533.12'
   // compile 'org.xwalk:xwalk_core_library:16.45.421.19'   
}

http://pastebin.com/WwWw0VB3

并且 运行 我的项目出现错误

Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class android.support.design.widget.CollapsingToolbarLayout

http://pastebin.com/V0XyqViC

移除时 编译 'org.xwalk:xwalk_core_library:20.50.533.12' 从 gradle 起,错误消失了

Stacktrace 还有以下内容:

caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method)

所以我建议检查与人行横道相关的混淆器设置。

-keep class org.xwalk.core.** { *; }

如果您将它与人行横道 webview 一起使用,则可能是 javascriptInterface。

另一种可能性是您在 crosswalk 核心库和 support-v4 中包含相同的模块。尝试在排除以下模块的情况下编译核心库:

compile 'org.xwalk:xwalk_core_library:16.45.421.19'  
{
        exclude module: 'support-v4'
        exclude module: 'support-annotations'
        exclude module: 'jsr305'
}

使用以下代码片段解决了问题

compile('com.android.support:support-v4:25.2.0') {
        force = true;
    }