react-native-reanimated模块导致Android应用程序在启动时崩溃

inn6fuwd  于 2023-10-22  发布在  React
关注(0)|答案(1)|浏览(149)

我正在使用Expo管理的工作流程构建一个react原生应用程序,当我在Expo Go应用程序中测试时,它工作得很好。当我尝试在一个独立的应用程序中进一步测试它时,通过创建一个APK文件,将其加载到Android,并打开它,它立即崩溃。
通过阅读错误日志(参见下面的关键摘录),似乎操作问题是react-native-reanimated模块,我没有主动安装,但似乎间接依赖于@react-navigation/stack。
我尝试了以下方法:

  • 使用npx expo install主动安装最新版本的react-native-reanimated
  • 确保@react-navigation/stack的依赖模块(react-native-screens和react-native-gesture-handling)使用正确版本的react-native-reanimated

有人知道该怎么做吗?

08-29 02:13:46.129 15060 15060 F DEBUG   :       #00 pc 0000000000076c58  /data/app/~~UGWiDx2QfyqHzMzDz3yeJA==/com.orderly.ios-8kJ1mW4XV4HiJGnvR0RZ1A==/lib/arm64/libreanimated.so (BuildId: 49e1dad0ba9bb0991bf54ebcc3a00d351229d18e)
08-29 02:13:46.129 15060 15060 F DEBUG   :       #01 pc 000000000008d154  /data/app/~~UGWiDx2QfyqHzMzDz3yeJA==/com.orderly.ios-8kJ1mW4XV4HiJGnvR0RZ1A==/lib/arm64/libreanimated.so (reanimated::Scheduler::triggerUI()+176) (BuildId: 49e1dad0ba9bb0991bf54ebcc3a00d351229d18e)
08-29 02:13:46.129 15060 15060 F DEBUG   :       #02 pc 0000000000090a0c  /data/app/~~UGWiDx2QfyqHzMzDz3yeJA==/com.orderly.ios-8kJ1mW4XV4HiJGnvR0RZ1A==/lib/arm64/libreanimated.so (facebook::jni::detail::MethodWrapper<void (reanimated::AndroidScheduler::*)(), &(reanimated::AndroidScheduler::triggerUI()), reanimated::AndroidScheduler, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>)+44) (BuildId: 49e1dad0ba9bb0991bf54ebcc3a00d351229d18e)
08-29 02:13:46.129 15060 15060 F DEBUG   :       #03 pc 0000000000090978  /data/app/~~UGWiDx2QfyqHzMzDz3yeJA==/com.orderly.ios-8kJ1mW4XV4HiJGnvR0RZ1A==/lib/arm64/libreanimated.so (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>))+60) (BuildId: 49e1dad0ba9bb0991bf54ebcc3a00d351229d18e)
08-29 02:13:46.129 15060 15060 F DEBUG   :       #04 pc 000000000008f924  /data/app/~~UGWiDx2QfyqHzMzDz3yeJA==/com.orderly.ios-8kJ1mW4XV4HiJGnvR0RZ1A==/lib/arm64/libreanimated.so (facebook::jni::detail::MethodWrapper<void (reanimated::AndroidScheduler::*)(), &(reanimated::AndroidScheduler::triggerUI()), reanimated::AndroidScheduler, void>::call(_JNIEnv*, _jobject*)+36) (BuildId: 49e1dad0ba9bb0991bf54ebcc3a00d351229d18e)
xlpyo6sf

xlpyo6sf1#

我在React-native expo项目中也遇到了同样的问题。

//package.json

"react-native": "0.72.4",
"react-native-reanimated": "~3.3.0",
"react-native-screens": "~3.22.0",
"@react-navigation/native": "^6.1.8",

截至今天(2023年10月19日),react-native-reanimated的最新版本是'3.5.4',更新到该版本为我修复了这个问题。

相关问题