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

Unrecognized command 'android' with react-native 0.31 #9312

Closed
SupriyaKalghatgi opened this issue Aug 9, 2016 · 19 comments
Closed

Unrecognized command 'android' with react-native 0.31 #9312

SupriyaKalghatgi opened this issue Aug 9, 2016 · 19 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@SupriyaKalghatgi
Copy link

SupriyaKalghatgi commented Aug 9, 2016

screen shot 2016-08-09 at 5 19 02 pm

@satya164
Copy link
Contributor

satya164 commented Aug 9, 2016

can you run ls in your project and post the results?

@adamboduch
Copy link

I depend on the react-native android command for generating the project. This allows me to blow away the android directory. I do this because I like to create a lot of smaller react-native apps for experimentation, and the disk space starts to add up if I don't delete ios and android.

Is there a away around this, or perhaps a different approach I should take for maintaining lots of little, unrelated react-native projects?

@SupriyaKalghatgi
Copy link
Author

@satya164 The android folder structure goes this way on react-native upgrade
screen shot 2016-08-09 at 10 01 31 pm

@ThaJay
Copy link

ThaJay commented Aug 11, 2016

subscribing.
I nuke my android folder sometimes. What happened to react-native android?

@adamboduch
Copy link

My current work-around is to have a generate-android-project.js script that looks like this:

const fs = require('fs');
const generate = require('react-native/local-cli/generate/generate.js');

generate([
  '--platform', 'android',
  '--project-path', process.cwd(),
  '--project-name', JSON.parse(
    fs.readFileSync('package.json', 'utf8')
  ).name,
]);

Then you can just:

node generate-android-project.js

This has the exact same effect as:

react-native android

@SupriyaKalghatgi
Copy link
Author

But what about react-native android?
There has to be replacement command for this instead

@administerspice
Copy link

administerspice commented Aug 17, 2016

I have this issue as well. I have run react-native upgrade. Even the script workaround is not working. Using "react-native": "0.31.0".


$ react-native run-android
Android project not found. Maybe run react-native android first?

$ react-native android
  Unrecognized command 'android'
  Run react-native --help to see list of all available commands

$ ls
RouterConfig.js     components      ios         package.json
android         index.android.js    node_modules
assets          index.ios.js        notes

@satya164
Copy link
Contributor

cc @grabbou @Kureev can you take a look at this one please?

@ghost ghost closed this as completed in 993cfa1 Aug 23, 2016
grabbou added a commit that referenced this issue Aug 25, 2016
Summary:
Fixes #9312

(Sorry for inconvenience, could've been removed by mistake!)

Bonus: projectName can be configured rather than always defaulting to package.json name, not sure if helpful, but just added it since we have a `default` function that makes sense in this case.
Closes #9525

Differential Revision: D3753610

Pulled By: bestander

fbshipit-source-id: 641872855b9865502f4055910262686edc4b504e
@Flavien
Copy link

Flavien commented Dec 18, 2016

This should be reopened as this still happens on the latest version.

@SupriyaKalghatgi
Copy link
Author

@Flavien With latest of RN
react-native upgrade does the complete work for you

@cogwheel
Copy link

I still get the Android project not found error after running react-native upgrade, and it still suggests running a non-existent command. This should be reopened.

@temitope
Copy link

@cogwheel any fix for adding android/ios folders to an RN project?

@a1exlism
Copy link

a1exlism commented Mar 3, 2017

@SupriyaKalghatgi Thanks for your update.

@av1v3k
Copy link

av1v3k commented May 9, 2017

This should be definitely re-opened as it causes the same error.

@av1v3k
Copy link

av1v3k commented May 9, 2017

image

@av1v3k
Copy link

av1v3k commented May 10, 2017

OK. My Problem got fixed by enabling Virtual Device from BIOS in Windows 10 and ran the emulator in Background (I am novice to Android)! But still, why it didn't run in my connected Android device directly ?

@jose2007kj
Copy link

thanks @SupriyaKalghatgi

@huxaiphaer
Copy link

Whats the final answer ? me too am stuck

@jose2007kj
Copy link

@huxaiphaer react-native upgrade hopes this will help as said by @SupriyaKalghatgi

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests