Skip to content

Conversation

@rmaafs
Copy link
Contributor

@rmaafs rmaafs commented Sep 25, 2021

Summary:

In windows, when I execute npx react-native run-android, I got this problem:

image

It's because my Windows name profile is "Rodrigo Maafs" (with a space)

image

The error is caused from getDevices(adbPath), adbPath have 3 arguments, looks like:

image

So, I fixed this adding " in the adb path:

image

Test Plan:

  1. Use Windows.
  2. Use a "adb path" in folder with a space.
  3. Check if the environment PATH, have the adb path correctly.
  4. Execute the app, in my case I use npx react-native run-android

image

After fixed it, looks like
after

Copy link
Member

@grabbou grabbou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Your research is really impressive! I think we can further simplify the changes you have in your PR and definitely ship it, since it's going to affect quite a few with the spaces in the username.

Efren Peredo and others added 2 commits November 5, 2021 12:22
@rmaafs rmaafs changed the title Fix Windows unknown command on build android fix: Windows unknown command on build android Nov 5, 2021
@rmaafs
Copy link
Contributor Author

rmaafs commented Nov 5, 2021

✔ Tested on Mac. Thanks @efrenperedo

@rmaafs rmaafs requested a review from grabbou November 5, 2021 21:47
@grabbou
Copy link
Member

grabbou commented Jan 24, 2022

My question is - why don't we wrap it with "" all the time? I don't think we need a special if condition to do it only when the string contains spaces.

@thymikee

@thymikee
Copy link
Member

@grabbou sure we can go with it by default

@thymikee thymikee merged commit 16de98e into react-native-community:master Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants