reanimated版本问题(无法确定Reanimated原生部分的版本。)

问题描述 投票:0回答:3

我正在尝试练习这个视频。

https://youtu.be/R7vyLItMQJw (PinchGestureHandler 与 React Native Reanimated 2 的基础知识)

但我的应用程序无法触摸。

我收到此错误

[Reanimated] 无法确定Reanimated原生部分的版本。您是否在升级react-native-reanimated后忘记重新构建应用程序?如果您使用 Expo Go,则必须使用捆绑到 Expo SDK 中的确切版本。

如何解决这个问题?

首先。我升级了Expo SDK。

但我仍然遇到同样的错误。

第二。重新构建应用程序。

但我仍然遇到同样的错误。

第三。我再次安装reanimated。但仍然是同样的错误。

react-native expo pinchzoom react-native-reanimated react-native-reanimated-v2
3个回答
3
投票

那是因为您安装的Reanimated版本与您的expo包版本不兼容。尝试在终端中运行它:

expo doctor --fix-dependencies

然后运行

expo start

npm start

您通常输入的任何命令来打开开发服务器


0
投票

我现在也遇到了同样的问题。 以下解决了我的问题:

npx expo start --clear

希望它也适合你。


0
投票

根据文档 当 Reanimated 无法确定其本机部分的版本时,就会发生这种情况。检查您是否在升级react-native-reanimated后重建了应用程序。如果您使用 Expo Go,则必须使用捆绑到 Expo SDK 中的确切版本。 我使用

npm uninstall react-native-reanimated
卸载了之前安装的react-native-reanimated,然后使用此命令
npx expo install react-native-reanimated
安装了与expo SDK兼容的reanimated版本

© www.soinside.com 2019 - 2024. All rights reserved.