【问题标题】:Unable to use webrtc in react native无法在本机反应中使用 webrtc
【发布时间】:2020-04-06 08:24:50
【问题描述】:

我正在尝试在我的 react native 应用程序中使用 webrtc,但是每当我安装我的应用程序时,它会自动关闭,这在我在我的应用程序中安装 react-native-webrtc 包之后开始发生,在我的应用程序运行之前 这是我的 package.json

{
  "name": "demoApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "react": "16.11.0",
    "react-native": "0.62.1",
    "react-native-webrtc": "^1.75.0"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@babel/runtime": "^7.9.2",
    "@react-native-community/eslint-config": "^1.0.0",
    "babel-jest": "^25.2.6",
    "eslint": "^6.8.0",
    "jest": "^25.2.7",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-test-renderer": "16.11.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

我什至尝试了 react-native-webrtc 的 1.75.1 和 1.75.0 版本,但问题仍然相同

【问题讨论】:

    标签: reactjs react-native webrtc


    【解决方案1】:

    安装 react-native-webrtc 包后,

    你必须关注this guide

    【讨论】:

      【解决方案2】:

      只需将其添加到您的 gradle.properties 中: android.enableDexingArtifactTransform.desugaring=false

      享受吧!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-08-17
        • 1970-01-01
        • 1970-01-01
        • 2017-09-20
        相关资源
        最近更新 更多