beansoft / react-native-console

🧩 an IDEA/WebStorm/Android Studio Plugin for One-Click run React Native commands in embed terminal
BSD 3-Clause "New" or "Revised" License
184 stars 28 forks source link

Android AVD Listing not working. #43

Closed sahilchopra03 closed 4 years ago

sahilchopra03 commented 4 years ago
Screenshot 2020-02-05 at 12 19 56 PM
beansoft commented 4 years ago

I've found this issue, but seems a android command line issue, not my plugin's fault. see https://github.com/ionic-team/ionic/issues/14291 there is a fix script, but i didn't tried yet:

export ANDROID_SDK_ROOT=/Users/[username]/Library/Android/sdk export PATH=$ANDROID_SDK_ROOT/emulator:$ANDROID_SDK_ROOT/tools:$PATH Where [username] is the name of your user folder.

But don't just run those commands or the change won't stay. You should add those lines to your ".bashrc" or ".bash_profile" and after that you need to reload the bash, restart the console or source the edited file, e.g. "me@localhost:~$ source .bashrc"

But keep in mind those are the folders that worked for me, your system might be using different ones, check the folder before you change anything, you should find there the emulator.

dimaportenko commented 4 years ago

The emulator path was changed at some point. Now it should be /Users/my_user/Library/Android/sdk/emulator/emulator instead of /Users/my_user/Library/Android/sdk/tools/emulator

beansoft commented 4 years ago

Thx for your info, i've tried new location, it does work. I'll fix it soon.

beansoft commented 4 years ago

try this plugin jar first: https://github.com/beansoftapp/react-native-console/blob/2019.2/react-native-console.jar

sahilchopra03 commented 4 years ago

try this plugin jar first: https://github.com/beansoftapp/react-native-console/blob/2019.2/react-native-console.jar

This one is also not working. The new location is : /Users/my_user/Library/Android/sdk/emulator and not /Users/my_user/Library/Android/sdk/emulator/emulator

dimaportenko commented 4 years ago

try this plugin jar first: https://github.com/beansoftapp/react-native-console/blob/2019.2/react-native-console.jar

I got this

Screenshot 2020-02-05 at 13 45 28

I don't see any errors in the console.

beansoft commented 4 years ago

Crate avd can't be done by simply using command line tools, so please open Androd Studio to create one.

dimaportenko commented 4 years ago

Nevermind, it is working now, probably an additional IDE restart was required.

swayok commented 4 years ago

Hi. I'm getting "no Android AVD found" error. OS is Windows 10. I have added all required environment variables for Android SDK, emulator and tools. I can run emulator manually using emulator.exe but plugin still don't see it. Running Android Studio and AVD manager does not help. My SDK is placed in E:\AndroidSDK and emulator is in E:\AndroidSDK\emulator I think that there is something wrong with emulator detection

beansoft commented 4 years ago

I found the android sdk with following steps:

  1. find ANDROID_HOME env
  2. or using android/local.properties , there should be a sdk.dir config entry. Then plus the dir + /emulator.

Can you check your win10 env to see there is a ANDROID_HOME point to the SDK dir?

My be a should trying to find it from PATH env first.

swayok commented 4 years ago

Added ANDROID_HOME env - nothing changed. Here are my env variables: ANDROID_HOME - E:\AndroidSDK ANDROID_SDK_ROOT - E:\AndroidSDK PATH - E:\AndroidSDK\emulator;E:\AndroidSDK\tools;E:\AndroidSDK\platform-tools Maybe it would be easier to configure SDK path from Welcome screen?

I cannot find android/local.properties file. Maybe because I'm using Expo SDK.

stephanoparaskeva commented 4 years ago
Screenshot 2020-04-20 at 22 12 48

@beansoftapp Location is here: /Users/<username>/Library/Android/sdk/tools/emulator

Screenshot 2020-04-20 at 22 47 39

But plugin react-native-console cannot find it:

Screenshot 2020-04-20 at 22 49 25

To Fix:

Add these two lines to the top of your .zshrc or .bashrc file:

export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK=$ANDROID_HOME/lib
beansoft commented 4 years ago

Please try the latest plugin https://github.com/beansoftapp/react-native-console/blob/2019.2/react-native-console.jar

I've try to find emulator from PATH env first, then through the config files. With this version, can fix this by: sudo ln -s /Users/my_user/Library/Android/sdk/emulator /usr/bin/emulator