Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error Unrecognized command "run-android". #36235

Closed
maniac-tech opened this issue Feb 21, 2023 · 1 comment
Closed

error Unrecognized command "run-android". #36235

maniac-tech opened this issue Feb 21, 2023 · 1 comment
Labels
Platform: Android Android applications. Resolution: Answered When the issue is resolved with a simple answer

Comments

@maniac-tech
Copy link

maniac-tech commented Feb 21, 2023

Description

I have an existing react-native project, which is currently broken, and is showing the following error:

error Unrecognized command "run-android".

Version

0.71.3

Output of npx react-native info

System:
    OS: macOS 12.5.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Memory: 46.17 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.20.0 - ~/.nvm/versions/node/v14.20.0/bin/node
    npm: 9.5.0 - ~/.nvm/versions/node/v14.20.0/bin/npm
    Watchman: 2023.02.20.00 - /usr/local/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 30, 31, 32, 33
      Build Tools: 23.0.1, 30.0.2, 30.0.3, 33.0.0
      System Images: android-30 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-31 | Google APIs Intel x86 Atom_64
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: /undefined - /usr/bin/xcodebuild
  npmGlobalPackages:
    react-native: 0.71.3

Steps to reproduce

Just pull, and run npx react-native run-android

Snack, code example, screenshot, or link to a repository

https://github.com/maniac-tech/react-native-expo-read-sms

@cortinico
Copy link
Contributor

Thanks for providing a reproducer.
The issue is that the linked project is not a valid RN project.

Specifically you have a peerDependency on RN 0.41:
https://github.com/maniac-tech/react-native-expo-read-sms/blob/ceb1eaca2a2b309724e64b9d4bd964206c26f510/package.json#L17-L19

That's how the package.json of a RN project should look like:

"dependencies": {
"react": "18.2.0",
"react-native": "0.71.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native-community/eslint-config": "^3.2.0",
"@tsconfig/react-native": "^2.0.2",
"@types/jest": "^29.2.1",
"@types/react": "^18.0.24",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.73.7",
"prettier": "^2.4.1",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
},

@cortinico cortinico added Resolution: Answered When the issue is resolved with a simple answer and removed Needs: Triage 🔍 labels Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Android applications. Resolution: Answered When the issue is resolved with a simple answer
Projects
None yet
Development

No branches or pull requests

3 participants