React Native-在Android上启动应用程序时遇到的问题

时间:2020-08-10 09:11:01

标签: android react-native

我在使用React native并在Android上运行应用程序时遇到问题(由yarn运行)。 控制台不会告诉我太多:(

BUILD SUCCESSFUL in 42s
25 actionable tasks: 3 executed, 22 up-to-date
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT
info Starting the app...
'adb' is not recognized as an internal or external command,
operable program or batch file.
error Failed to start the app. Run CLI with --verbose flag for more details.
Error: Command failed: adb shell am start -n com.theoplayerreactnative/com.theoplayerreactnative.MainActivity
    at makeError (C:\Users\mKochman\Dev\theo\reactnative-app\node_modules\execa\index.js:174:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

因此构建了应用,并在实际设备上安装了该应用,但无法启动它:(

package.json

"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": "npm:react-native-tvos@0.62.2-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.58.0",
    "react-test-renderer": "16.11.0"
  },

1 个答案:

答案 0 :(得分:0)

好吧,我把那个XD固定了 在我的情况下需要什么:

  • 分级更新
  • 设置adb(Windows)的环境路径
  • 清除所有版本
  • 系统重启
相关问题