【问题标题】:React Native CLI uses autolinking for native dependencies, but the following modules are linked manually react-native-webviewReact Native CLI 对本机依赖项使用自动链接,但以下模块是手动链接的 react-native-webview
【发布时间】:2019-12-20 23:26:24
【问题描述】:

我是 ReactNative 的新手,所以我想打开一个 Web 视图并使用以下命令安装 WebView:

npm install --save react-native-webview
npx react-native link react-native-webview

现在当我运行这个时:

npx react-native run-android --deviceId 127.0.0.1:62001

向我返回这个错误:

React Native CLI 对原生依赖项使用自动链接,但以下模块是手动链接的: - react-native-webview(取消链接运行:“react-native unlink react-native-webview”) 将 React Native 从 0.60 以下升级到 0.60 或以上时,可能会发生这种情况。

    "dependencies": {
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-webview": "^8.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.6.2",
    "@babel/runtime": "^7.6.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "eslint": "^6.5.1",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.56.0",
    "react-test-renderer": "16.9.0"
  },

我该怎么办?

【问题讨论】:

    标签: javascript react-native react-native-android


    【解决方案1】:

    React native 0.60 及更高版本使用自动链接。这意味着您不需要手动链接。

    现在你必须取消链接库

    npx react-native unlink react-native-webview
    

    然后

    npx react-native run-android
    

    【讨论】:

      猜你喜欢
      • 2020-11-04
      • 1970-01-01
      • 2021-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-22
      • 2020-01-14
      相关资源
      最近更新 更多