代码之家  ›  专栏  ›  技术社区  ›  Brian Var

如何解决在react本机开发模式下需要授予的覆盖权限?

  •  0
  • Brian Var  · 技术社区  · 7 年前

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.simpleoffsetpro"
        xmlns:tools="http://schemas.android.com/tools">
        <uses-permission tools:node="remove" android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    </manifest>
    
    

    但当我在安卓8.0上运行该应用程序时,我会授予提示“允许在其他应用程序上绘图”的权限。然后应用程序只显示一个带有通知的灰色屏幕- Overlay permissions needs to be granted in order for react native apps run in dev mode

    设备:华为P Smart-安卓8.0.0

    如何解决在react本机开发模式下需要授予的覆盖权限?

    Package.json依赖项:

    "dependencies": {
        "bluebird": "^3.3.5",
        "convert-units": "^2.3.4",
        "event-emitter": "^0.3.4",
        "immutability-helper": "^2.8.1",
        "immutable": "^3.7.6",
        "lodash": "^4.11.0",
        "moment": "^2.12.0",
        "native-base": "2.0.12",
        "react": "~15.4.2",
        "react-dom": "~15.4.2",
        "react-native": "0.42.0",
        "react-native-awesome-alerts": "^1.0.6",
        "react-native-dismiss-keyboard": "^1.0.0",
        "react-native-floating-label-text-input": "^0.1.4",
        "react-native-hide-with-keyboard": "^1.0.0",
        "react-native-keyboard-listener": "^1.1.0",
        "react-native-localization": "^1.0.11",
        "react-native-material-initials": "^0.0.12",
        "react-native-overlay": "^0.5.0",
        "react-native-popup-menu": "^0.12.3",
        "react-native-swiper": "^1.5.13",
        "react-native-vector-icons": "^4.0.0",
        "react-redux": "^4.4.5",
        "redux": "^3.4.0",
        "redux-logger": "^2.6.1",
        "redux-loop-symbol-ponyfill": "^2.2.0",
        "redux-promise": "^0.5.3",
        "redux-thunk": "^2.0.1",
        "standard-http-error": "^2.0.0"
      },
      "devDependencies": {
        "babel-core": "^6.9.0",
        "babel-eslint": "^7.1.0",
        "babel-jest": "^17.0.2",
        "babel-polyfill": "^6.9.0",
        "babel-preset-react-native": "^1.9.0",
        "babel-preset-stage-0": "^6.5.0",
        "babel-register": "^6.9.0",
        "enzyme": "^2.2.0",
        "eslint": "^3.10.1",
        "eslint-plugin-babel": "^3.2.0",
        "eslint-plugin-react": "^6.7.1",
        "fetch-mock": "^5.5.0",
        "istanbul": "1.0.0-alpha.2",
        "jasmine": "^3.1.0",
        "jest": "^17.0.2",
        "react-addons-test-utils": "~15.4.2",
        "react-native-mock": "~0.2.5",
        "react-test-renderer": "^16.3.2",
        "remote-redux-devtools": "^0.5.7",
        "rimraf": "^2.5.2"
      }
    

    enter image description here

    2 回复  |  直到 7 年前
        1
  •  1
  •   RegularGuy    7 年前

    安卓奥利奥是 only supported 从RN 0.51+,更新您的react native,最新版本是0.58,新版本0.59将为react native 7u7带来挂钩

        2
  •  0
  •   Kai    7 年前

    这条线应该是这样的:

    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    

    推荐文章