人行横道 Xwalk Webview 冲突 折叠工具栏布局<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。

另一种可能性是,您在人行横道核心库和支持 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;
    } 

相关内容

最新更新