2017-01-05 39 views
1

我的項目已經 CollapsingToolbarLayout 實施了UI效果人行橫道Xwalk網頁視圖衝突CollapsingToolbarLayout <android.support.design.widget>

當我添加

編譯 '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這個錯誤消失

回答

0

使用下面的代碼片段固定的問題

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

堆棧跟蹤也有以下幾點:

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

所以我建議檢查與人行橫道有關的proguard設置。

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

如果在人行橫道web視圖中使用它,可能會出現javascriptInterface。

另一種可能性是,您在Crosswalk核心庫和support-v4中包含相同的模塊。嘗試編譯內核的lib有以下幾個模塊的排斥:

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