添加RealmReactPackage后,Android应用立即崩溃

时间:2018-07-03 16:01:02

标签: android react-native realm realm-mobile-platform

我按照领域页面上的说明进行了以下步骤:

  • npm install realm
  • react-native link realm->对于iOS,目前一切正常,无需任何进一步的步骤。
  • 打开android studio并更新settings.gradle,app / build.gradle中的更改,并将RealmReactPackage导入MainApplication.java

如果我构建并启动该应用程序,则一切正常。然后,我将new RealmReactPackage()添加到其他ReactPackages的列表中。

如果我现在启动应用程序,则该应用程序立即崩溃。 logcat没有说出崩溃的任何原因,但是我还是在下面添加了输出。

我已经尝试过的事情:

  • 清除缓存
  • 重新启动打包程序
  • 从模拟器中卸载应用
  • 清除节点模块,然后再次运行npm install,然后重复上述步骤

我的设置:

  • “反应”:“ 16.3.1”,
  • “ react-native”:“ 0.55.4”,
  • “ react-native-navigation”:“ v2.0.1937”
  • 节点版本9.5.0
  • Android Studio版本:3.1.3

我到目前为止没有做的事情

领域站点Examples下有一条指令:

Note that on Android, you need the NDK installed and must have set the ANDROID_NDK environment variable.

export ANDROID_NDK=/usr/local/Cellar/android-ndk/r10e

我的问题是,这与我的配置有关还是与示例有关?

LogCat输出:

    07-03 17:51:04.909  1664  1676 I ActivityManager: START u0 {flg=0x10100000 cmp=com.cowoperation/.MainActivity} from uid 2000
07-03 17:51:04.938  1664  2392 I ActivityManager: Start proc 32299:com.cowoperation/u0a91 for activity com.cowoperation/.MainActivity
07-03 17:51:05.319 32299 32325 V FA      : App package, google app id: com.cowoperation, 1:314188610363:android:2d8c823aa5045bd7
07-03 17:51:05.320 32299 32299 V fb-UnpackingSoSource: locked dso store /data/user/0/com.cowoperation/lib-main
07-03 17:51:05.320 32299 32325 I FA      :   adb shell setprop debug.firebase.analytics.app com.cowoperation
07-03 17:51:05.320 32299 32299 I fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.cowoperation/lib-main
07-03 17:51:05.321 32299 32299 V fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.cowoperation/lib-main
07-03 17:51:05.654 32299 32345 I zygote  : Thread[30,tid=32345,Native,Thread*=0x88b19a00,peer=0x13214b48,"Thread-8"] recursive attempt to load library "/data/app/com.cowoperation-gxY-ptC8QV3xKg796vAtEA==/lib/x86/libfb.so"
07-03 17:51:05.808  1664  1690 I ActivityManager: Displayed com.cowoperation/.MainActivity: +878ms
07-03 17:51:05.880 32299 32325 V FA      : Event recorded: Event{appId='com.cowoperation', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-6439080053319785913}]}
07-03 17:51:05.979 32299 32345 E AndroidRuntime: Process: com.cowoperation, PID: 32299
07-03 17:51:05.979 32299 32345 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN5realm8jni_util9hack_initEv" referenced by "/data/app/com.cowoperation-gxY-ptC8QV3xKg796vAtEA==/lib/x86/librealmreact.so"...
07-03 17:51:05.980 32299 32345 E UncaughtException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN5realm8jni_util9hack_initEv" referenced by "/data/app/com.cowoperation-gxY-ptC8QV3xKg796vAtEA==/lib/x86/librealmreact.so"...
07-03 17:51:06.074 32299 32325 V FA      : Event recorded: Event{appId='com.cowoperation', name='app_exception(_ae)', params=Bundle[{firebase_event_origin(_o)=crash, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-6439080053319785913, timestamp=1530633065983, fatal=1}]}
07-03 17:51:06.153 32299 32325 V FA      : Event recorded: Event{appId='com.cowoperation', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=596, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-6439080053319785913}]}
07-03 17:51:06.359  1664  2392 W ActivityManager:   Force finishing activity com.cowoperation/.MainActivity
07-03 17:51:06.373  1664  1684 I ActivityManager: Showing crash dialog for package com.cowoperation u0
07-03 17:51:06.569 32299 32325 V FA      : Event recorded: Event{appId='com.cowoperation', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=266, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-6439080053319785913}]}

0 个答案:

没有答案