在我的应用程序中,我必须使用 Realm 和 Crosswalk 库。我从 gradle 中导入了 Realm,如下所示:
Project gradle
dependencies {
classpath "io.realm:realm-gradle-plugin:2.2.1"
}
//------------------------
App module gradle
apply plugin: 'realm-android'
和 Crosswalk 应用程序就像一个单独的项目(不是来自 gradle )。当我运行我的应用程序时,它会因以下日志而崩溃:
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
但是,当我从 gradle Crosswalk 中删除 Realm 符号时,Crosswalk 运行得很好......那么我怎样才能同时使用 Realm 和 Crosswalk 呢?