DiemasMichiels / emulator

Run Android emulator and iOS simulator easily from VScode!
MIT License
98 stars 34 forks source link

Something went wrong fetching you Android emulators #14

Closed hungga1711 closed 5 years ago

hungga1711 commented 5 years ago

When i view list android emulator, i got 2 messages:

My emulator path in the setting is correct.

C:\Users\HUNG\AppData\Local\Android\Sdk\emulator\emulator.exe

How to resolve it ? Sorry if you don't understand. My english is very bad ^_^

DiemasMichiels commented 5 years ago

Hello @hungga1711

Can you try to run this command in your command prompt?: C:\Users\HUNG\AppData\Local\Android\Sdk\emulator\emulator.exe\emulator -list-avds

What does it show?

antonholmberg commented 5 years ago

This is related to my update with #13. Point it to the directory instead of the actual executable file instead and I think it should work just fine!

So path should now be C:\Users\HUNG\AppData\Local\Android\Sdk\emulator

Not sure if I need to add .exe when running in windows. Like I mentioned in my PR I haven't actually tested it on windows yet so it's really nice that I get some feedback for that!

DiemasMichiels commented 5 years ago

Correct, overlooked the .exe I'll make a check for it so you get a better error ;)

Your PR is merged and worked like it should, I haven't had any problems with it! I tested it on my windows computer.

antonholmberg commented 5 years ago

@DiemasMichiels Awesome to hear! This extension has saved me so much time and is simply amazing! 🥇

RodrigoSaka commented 5 years ago

Same here: image image image In previous version (0.0.7) it works with: "emulator.emulatorPath": "%ANDROID_HOME%/emulator/emulator.exe" But now (1.0.0): image Only works when i use absolute path like: "emulator.emulatorPath": "C:\Users\RodrigoSaka\AppData\Local\Android\Sdk\emulator" image Can make it works with variable path again?

hungga1711 commented 5 years ago

Thank @antonholmberg . I removed .exe and it work well.
The correct path: C:\Users\HUNG\AppData\Local\Android\Sdk\emulator.

antonholmberg commented 5 years ago

@RodrigoSaka I think I know what the problem is. Will see if I can reproduce it on a mac on monday. If not it would be great if you could help me out with testing it from a branch before merging it in.

antonholmberg commented 5 years ago

@RodrigoSaka I was able to reproduce the issue on a mac. Have a fix for it here https://github.com/antonholmberg/Emulator/tree/feature/expand-path

It would be great if you could try it from that branch and see if it works on windows too.

DiemasMichiels commented 5 years ago

Thanks again @antonholmberg! @RodrigoSaka can verify this so we can merge it and I can create a new build? If not I can test it.

antonholmberg commented 5 years ago

@DiemasMichiels Yeah if you could try it out that would be great. I assumed that echo $ANDROID_HOME works the same on windows with echo %ANDROID_HOME%. Not sure if this is actually the case though.

RodrigoSaka commented 5 years ago

@DiemasMichiels @antonholmberg Unfortunately it did not work here as you can see: image image Error message: Something went wrong fetching you Android emulators! Make sure your path is correct. Try running this command in your terminal: "C:\Users\RodrigoSaka\AppData\Local\Android\Sdk\emulator"\emulator -list-avds.

RodrigoSaka commented 5 years ago

Detail, absolute path without variable path does not work.

antonholmberg commented 5 years ago

Look like echo "hello" returns "hello" on windows and just hello on *nix systems. I have pushed an update to the branch I linked to earlier that simply strips out " from the return of the echo. Please give it another go @RodrigoSaka 😄

RodrigoSaka commented 5 years ago

@antonholmberg that so crazy lol I sent a request because it is easier to edit myself than to be testing and sending feedback

antonholmberg commented 5 years ago

@RodrigoSaka I created a PR! Thanks for the help. Your code was a lot cleaner than two replace

RodrigoSaka commented 5 years ago

@antonholmberg That was nothing compared to what they've done lol Important is that I managed to help in some way, I really like this extension and I wanted to contribute in some way. Thank you!!

DiemasMichiels commented 5 years ago

@antonholmberg @RodrigoSaka New version should be available:

DONE - Published DiemasMichiels.emulate@1.0.1 Your extension will live at https://marketplace.visualstudio.com/items?itemName=DiemasMichiels.emulate (might take a few seconds for it to show up).

lucalves commented 3 years ago

Thanks all! Worked fine to me.

MehrazRumman commented 2 years ago

I am using ubuntu facing the same problem . Need some help !

53Za commented 2 years ago

I am using ubuntu facing the same problem . Need some help !

hey , if u have the same problem just make sure that u download Docker

starball5 commented 1 year ago

Related questions asked on Stack Overflow:

We can close the second and third posts as duplicates of the first once an answer in the first gets an upvote or gets accepted.