Good day. In my project I use the Realm and Crosswalk libraries. I imported the realm through the gradle in the following way:

Project gradle

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

App module gradle

 apply plugin: 'realm-android' 

and the Crosswalk library was imported as a project (and not through a gradle). And when I launch my application, it immediately closes 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 the Realm notation from Gradle, Crosswalk works great ... Question: How can I use both Realm and Crosswalk at the same time?

  • why do you think that this is a conflict between the Realm and Crosswalk libraries, and not an error in using Realm? - s_klepcha
  • On other devices it works fine. - Salut Amigo

1 answer 1

As far as I know, the problem here is the conflicts of the native libraries. I am far from being an expert in this area, but it is written in your logs that I cannot find native files ("libxwalkcore.so")

 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 

There is an application in the play market that monitor natives in the Native libs monitor apk file. It is quite simple and intuitive, it can help, in understanding what is missing, and for example, whether this file will be in the apk if you saw Rilm.

Most likely the problem is that there is a conflict of using different processor architectures. You have to, for example, force the use of 64bit architecture by Rilm, because you have the second one or it uses it, if I understood correctly from the log. Most likely, this can be done through the Gradle, we had something similar in the team when we played in the same project with Rilm. It was a long time ago, a lot of water has flowed under the bridge, and besides, it was not me who fixed it then. But maybe adding abiFilters to Gradle defaultConfig ->

 android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" defaultConfig ndk { abiFilters "armeabi", "armeabi-v7a", "x86", "mips" } } buildTypes { . . . } sourceSets { main { jniLibs.srcDirs = ['lib'] } } 

Also try to read here , the case is similar to yours and it looks like there is what you need (even if it is not specifically Rilme). If it does not help, do not despair and experiment with filters, google, study the subject area. I am sure everything will turn out, good luck!