1

I've scoured SO and Google and none of the suggestions have seemed to solve my issue.

I previously had Android Studio on this Mac. I decided to finally add nativescript and followed the docs 100%. I also updated Android Studio in the process. Keep in mind, I've also tried completely removing Android Studio and re-installing it manually. Nothing has change the results/symptoms that I'm experiencing below.

I'm actually getting two errors. One within Android Studio with a Pixel 2 8.0, Pixel 2 XL 8.0, Pixel 2 9.0 and Pixel 2 XL 9.0 emulators (newly created within Android Studio). The second error is when I attempt to run tns run android. It's also important to note that running tns run ios works perfectly and X Code opens and fires up an emulator perfectly.

Lastly, I want to share that I've tried to update my bash profile with both of the following suggestions found throughout the various similar issues online.

export ANDROID_HOME=/usr/local/share/android-sdk

export ANDROID_HOME=/Users/$myUsername/Library/Android/sdk

I updated and forced my updated exports with source ~/.bash_profile and have restarted my terminal and mac multiple times throughout my efforts to resolve this issue.

Lastly, I've also tried with Android Studio open and with Android Studio closed.

That said, here goes.

  1. Android Studio Error
    • Open up AVD Manager and try to start any of my emulators.
    • Immediately the following error appears...
      • Emulator: PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value

NOTES FOR ERROR 1: The path it suggests is a path I have verified contains the Android SDK. This is also the path that is set for my SDK inside Android Studio > SDK Manager > Android SDK > Android SDK Location.

enter image description here

  1. Command Line Error w/NativeScript CLI
    • I run tns run android
    • It seems to try to run its processes just fine. It comes up with one of my devices/emulators setup with Android SDK. It shows the device name correctly inside the command line.
    • The process seems to hang at this point for quite some time. Eventually it does die out with the following notes/errors.

Cannot find connected devices. Emulator start failed with: Cannot run your app in the native emulator. Increase the timeout of the operation with the --timeout option or try to restart your adb server with 'adb kill-server' command. Alternatively, run the Android Virtual Device manager and increase the allocated RAM for the virtual device. To list currently connected devices and verify that the specified identifier exists, run 'tns device'. To list available emulator images, run 'tns device --available-devices'.

Thanks in advance. I've redone all of this multiple times but I just can't get android emulators to work at all now that I've finally tried to setup a NativeScript workspace on this machine.

anothercoder
  • 563
  • 5
  • 10
  • Are you able to launch the emulator from Android Studio itself? If it causes error, then it's nothing to do with {N} CLI, it must be something wrong with Emulator itself. Make sure you downloaded the recommend image type for your processor. – Manoj Oct 04 '18 at 14:27
  • @Manoj Thanks for the reply. I am not able to run emulator from Android Studio either. In my question above I mention the error I get when trying to run the emulator directly from Android Studio. Could you provide a hint of insight for your statement about "Make sure you downloaded the recommended image type for your processor"? I ask because I'm on mac and I was only given one download option for mac. Thanks in advance. – anothercoder Oct 04 '18 at 18:48
  • Yes, there will be mostly only one image that will be recommended in mac environment. If you are already using that, make sure your environment variables are set properly by hitting commands like `android` / `adb` from terminal. – Manoj Oct 05 '18 at 07:07
  • Thanks @Manoj. When I type `android` into the command line I get some hints related to the android package, so I'm good there (it would seem). That said, when I hit `adb` in the command line I get "command not found" which leads me to believe that adb is not installed. I'm not familiar with adb. Is it this.... https://developer.android.com/studio/command-line/adb If so, I didn't see it in the nativescript instructions or the Android Studio setup instructions. Could you please let me know what I should do for that one? Just install that command line tool, or something else? – anothercoder Oct 06 '18 at 21:20
  • I thought I had it solved just now. I can now (in android studio) fire up an emulator that I create via the command line, but emulators that I create in Android Studio don't fire up still. I'm still getting :: Emulator: PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value – anothercoder Oct 06 '18 at 22:00

0 Answers0