繁体   English   中英

我正在尝试打开 React Native 应用程序,但我遇到了这个问题,解决办法是什么?

[英]I am trying to open the React Native application but I have this problem What is the solution?

$ react-native run-android
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
  - @react-native-community/geolocation (to unlink run: "react-native unlink @react-native-community/geolocation")
  - react-native-bluetooth-status (to unlink run: "react-native unlink react-native-bluetooth-status")
  - react-native-device-info (to unlink run: "react-native unlink react-native-device-info")
  - react-native-i18n (to unlink run: "react-native unlink react-native-i18n")
  - react-native-image-picker (to unlink run: "react-native unlink react-native-image-picker")
  - react-native-ux-cam (to unlink run: "react-native unlink react-native-ux-cam")
  - react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")

当将 React Native 从 0.60 以下升级到 0.60 或以上时,可能会发生这种情况。 展望未来,您可以通过“react-native unlink”取消链接此依赖项,它将自动包含在您的应用程序中。 如果库与自动链接不兼容,请忽略此消息并通知库维护者。 阅读有关自动链接的更多信息: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md info 运行 jetifier 将库迁移到 AndroidX。 您可以使用“--no-jetifier”标志禁用它。 Jetifier 找到 1225 个文件来转发-jetify。 使用 4 个工人... info JS 服务器已经在运行。 info 正在安装应用程序... 启动 Gradle 守护程序,无法重用 1 个不兼容的守护程序,使用 --status 获取详细信息

FAILURE:构建失败并出现异常。

  • 其中:构建文件 'C:\Users\User\Documents\GitHub\walleterp-mobile\node_modules@react-native-community\geolocation\android\build.gradle' 行:21

  • 出了什么问题:评估项目“:@react-native-community_geolocation”时出现问题。

    应用插件失败 [id 'com.android.library']

我在上一个项目中遇到了同样的问题,您可以尝试使用以下命令取消链接:react-native unlink 并删除所有依赖项:yarn remove 或 npm-uninstall 然后删除 yarn.lock、package-lock.json 和 npm-package-lock .json

并删除文件夹'Android'中的“build”文件夹,然后你可以使用yarn install或npm-install重新安装,然后尝试react-native run-android,

我个人创建了一个新项目并重新安装了所有依赖项,没有 react-native 链接,因为这个错误是配置问题,并且出现在新版本的 React Native 中,

希望对你有帮助

只需删除构建文件夹,然后重试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM