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

280 views Asked by At

My project has CollapsingToolbarLayout implemented for UI effect

when i add

compile '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

And run my project i get the error

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

http://pastebin.com/V0XyqViC

On removing compile 'org.xwalk:xwalk_core_library:20.50.533.12' from gradle the error disappears

2

There are 2 answers

0
Cowgirl On BEST ANSWER

Using the following snippet fixed the issue

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

Stacktrace also has following:

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

So I'd suggest to check proguard settings related to crosswalk.

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

And may be javascriptInterface if you use it with crosswalk webview.

Another possibility is that you have same module included in crosswalk core lib and in support-v4. Try to compile core lib with exclusion of following modules:

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