我在为 Android 运行我的 react-native 项目时遇到问题。下面是我的项目的输出。
System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
Memory: 1.33 GB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 13.8.0 - /usr/local/bin/node
npm: 6.13.7 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
IDEs:
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1
react-native: 0.61.5
我面临的错误是。
2021-03-02 19:15:51.950 8696-8746/com.xxxx D/SoLoader: libflipper.so not found on /data/user/0/com.xxxx/lib-main
2021-03-02 19:15:51.950 8696-8746/com.xxxx D/SoLoader: libflipper.so found on /data/app/~~JKMOYC8Kgh_0cyeIIIPfJw==/com.xxxx-A59UUF7pLW4jtdMOS9BPnQ==/lib/x86
2021-03-02 19:15:51.950 8696-8746/com.xxxx D/SoLoader: Not resolving dependencies for libflipper.so
2021-03-02 19:15:51.953 8696-8746/com.xxxx W/System.err: java.lang.UnsatisfiedLinkError: dlopen failed: library "libfbjni.so" not found: needed by /data/app/~~JKMOYC8Kgh_0cyeIIIPfJw==/com.xxxx-A59UUF7pLW4jtdMOS9BPnQ==/lib/x86/libflipper.so in namespace classloader-namespace
2021-03-02 19:15:51.953 8696-8746/com.xxxx W/System.err: at java.lang.Runtime.load0(Runtime.java:939)
2021-03-02 19:15:51.953 8696-8746/com.xxxx W/System.err: at java.lang.System.load(System.java:1628)
2021-03-02 19:15:51.953 8696-8746/com.xxxx W/System.err: at com.facebook.soloader.SoLoader$1.load(SoLoader.java:395)
2021-03-02 19:15:51.954 8696-8746/com.xxxx W/System.err: at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:77)
2021-03-02 19:15:51.954 8696-8746/com.xxxx W/System.err: at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:50)
2021-03-02 19:15:51.954 8696-8746/com.xxxx W/System.err: at com.facebook.soloader.ApplicationSoSource.loadLibrary(ApplicationSoSource.java:82)
2021-03-02 19:15:51.954 8696-8746/com.xxxx W/System.err: at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:766)
2021-03-02 19:15:51.954 8696-8746/com.xxxx W/System.err: at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:673)
2021-03-02 19:15:51.954 8696-8746/com.xxxx W/System.err: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:611)
2021-03-02 19:15:51.954 8696-8746/com.xxxx W/System.err: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:559)
2021-03-02 19:15:51.954 8696-8746/com.xxxx W/System.err: at com.facebook.flipper.android.EventBase.<clinit>(EventBase.java:19)
2021-03-02 19:15:51.954 8696-8746/com.xxxx W/System.err: at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
2021-03-02 19:15:51.955 8696-8746/com.xxxx E/SoLoader: couldn't find DSO to load: libflipper.so caused by: dlopen failed: library "libfbjni.so" not found: needed by /data/app/~~JKMOYC8Kgh_0cyeIIIPfJw==/com.xxxx-A59UUF7pLW4jtdMOS9BPnQ==/lib/x86/libflipper.so in namespace classloader-namespace result: 0
2021-03-02 19:15:51.956 8696-8747/com.xxxx E/AndroidRuntime: FATAL EXCEPTION:
FlipperConnectionThread
Process: com.xxxx, PID: 8696
java.lang.NoClassDefFoundError: <clinit> failed for class com.facebook.flipper.android.EventBase; see exception in other thread
at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
2021-03-02 19:15:51.959 8696-8746/com.xxxx I/Process: Sending signal. PID: 8696 SIG: 9
我已经完成了尽可能多的错误报告在模拟器 #707 上崩溃,SoLoader: 找不到要加载的 DSO:libflipperfb.so #515 ,找不到要加载的 DSO:和其他几个。
我尝试运行以下命令
rm -rf $HOME/.gradle/caches/
cd android && ./gradlew clean
以及来自我的 Android Studio (Android Studio 4.1.1) 的 Build -> Clean。但是,当我尝试运行该应用程序时,它仍然失败。
尝试在我的 gradle.properties 中将我的 Flipper 版本从 FLIPPER_VERSION=0.33.1 -> FLIPPER_VERSION=0.78.0 更改,但仍然没有用。