Realm conflicts with Crosswalk

530 views Asked by At

in my app I have to use Realm and Crosswalk libs. I have imported Realm from gradle like this:

Project gradle
dependencies {
        classpath "io.realm:realm-gradle-plugin:2.2.1"
    }

//----------------------

App module gradle
apply plugin: 'realm-android'

and Crosswalk app like a separate project ( not from gradle ). And when I run my app it crashes with the following logs:

I/art: Late-enabling -Xcheck:jni
D/XWalkLib: Pre init xwalk core in com.app.myapp.LoginActivty
D/XWalkActivity: Initialize by XWalkInitializer
D/XWalkLib: DecompressTask started
W/ResourceType: No package identifier when getting value for resource number 0x00000000
D/XWalkLib: Reserve object class com.app.myapp.CustomView.MyXwalkView to com.app.myapp.LoginActivty
D/XWalkLib: Reserve object class com.app.myapp.LoginActivty$ResourceClient to com.app.myapp.LoginActivty
D/XWalkLib: Reserve method setResourceClient to com.app.myapp.LoginActivty
D/XWalkLib: DecompressTask finished, 0
D/XWalkLib: ActivateTask started
D/XWalkLib: Attach xwalk core
D/XWalkLib: [App Version] build:22.52.561.4, api:7, min_api:1
D/XWalkLib: [Lib Version] build:22.52.561.4, api:7, min_api:5
D/XWalkLib: Crosswalk download mode: false
D/XWalkLib: XWalk core version matched
D/XWalkLib: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.app.myapp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.app.myapp-2/lib/arm64, /system/fake-libs64, /data/app/com.app.myapp-2/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libxwalkcore.so"
D/XWalkLib: java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/user/0/com.app.myapp/app_xwalkcore/libxwalkcore.so" not found
D/XWalkLib: Device ABI: arm64-v8a
D/XWalkLib: org.xwalk.core not found
D/XWalkLib: org.xwalk.core64 not found
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 2
D/XWalkLib: ActivateTask finished, 6
D/XWalkLib: Crosswalk APK download URL: 
D/XWalkLib: HttpDownloadTask started, 
E/XWalkLib: Invalid download URL 
D/XWalkLib: HttpDownloadTask finished, -1

But when I delete Realm notations from gradle Crosswalk runs perfectly... So how can I use both and Realm, and Crosswalk together ?

1

There are 1 answers

2
Nabil Hachicha On

which ABIs of the Crosswalk are you including with your app?

from the Logcat it seems that your project is trying to look for the arm64 version of Crosswalk library, but it can't find it in your APK.

Realm AAR comes with the following ABIs (arm64-v8a, armeabi-v7a, mips, x86 and x86_64), so when you load the Realm library your device will select the appropriate ABI available, in our case arm64-v8a. I presume your Crosswalk lib doesn't include arm64-v8a ABI, hence the error.