【问题标题】:I am trying to open the React Native application but I have this problem What is the solution?我正在尝试打开 React Native 应用程序,但我遇到了这个问题,解决办法是什么?
【发布时间】:2019-10-03 06:48:36
【问题描述】:
$ 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 服务器已经在运行。 信息 正在安装应用程序... 启动 Gradle Daemon,1 个不兼容的 Daemon 无法重用,使用 --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']

【问题讨论】:

  • 能否提供您的 android grandle 信息。(android/app/build.grandle, android/settings.grandle, android/build.grandle)
  • 谢谢..终于成功了

标签: javascript reactjs native


【解决方案1】:

我在上一个项目中遇到了同样的问题, 您可以尝试使用以下命令取消链接: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 链接,因为这个 bug 是配置问题,随着新版本的 React Native 出现,

希望对你有帮助

【讨论】:

  • 构建失败与自动链接无关。
【解决方案2】:

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

【讨论】:

    猜你喜欢
    • 2022-12-25
    • 1970-01-01
    • 2021-11-02
    • 1970-01-01
    • 1970-01-01
    • 2021-12-30
    • 2021-09-27
    • 2020-11-27
    • 1970-01-01
    相关资源
    最近更新 更多