android


Why won't Visual Studio 2017 run Android emulator? (Gives error ANDROID_SDK_ROOT missing)


I just installed Visual Studio 2017.
I started a Android Xamarin project from the template.
Project built successfully.
Then I attempted to run the app but the emulator failed.
I saw the following error:
1>Starting deploy Nexus_5X_API_22_Lollipop ...
1>Starting emulator
Nexus_5X_API_22_Lollipop ...
1>C:\PROGRA~2\Android\ANDROI~1\tools\emulator.EXE -partition-size 512
-no-boot-anim -avd Nexus_5X_API_22_Lollipop -prop monodroid.avdname=Nexus_5X_API_22_Lollipop
1>PANIC: Cannot find AVD
system path. Please define ANDROID_SDK_ROOT 1>Emulator
Nexus_5X_API_22_Lollipop cannot be started.
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
I already have Android Studio 2.3 installed on this same machine.
What do I need to do to resolve this?
Even though I have Android Studio 2.3 and a valid Environment variable named:
ANDROID_SDK_HOME, which Android Studio uses, it seems that I needed to add a new environment variable that points to the same location as ANDROID_SDK_HOME but is named ANDROID_SDK_ROOT (for use in Visual Studio 2017).
First go to File Explorer and right-click This PC:
Choose Properties menu item and computer settings swill appear.
Choose the Advanced System Settings link, on the left.
An new dialog box will appear -- System Properies with the advanced tab chosen for you.
Click the Environment Variables... button and another dialog box will appear.
At the bottom under system variables, add your new variable named :
ANDROID_SDK_ROOT with the path that points to your ANDROID SDK on your machine.
Once you save and close all the dialogs the Systen Environment Variable will be available. I believe I had to restart Visual Studio and then after that it found ANDROID_SDK_HOME and started my emulator with no problem.

Related Links

How to access a server running inside genymotion emulator from my computer?
how to disable the recent apps button in Android Lollipop
The method addJavascriptInterface(WebViewActivity.JavaScriptInterface, String) is undefined for the type CordovaWebView
How to automatically increase and release signed apk in Android Studio using Gradle script
Android Google Maps onMapReady store GoogleMap
Android : Custom List view Memory Leak
Fragment Implementing LocationListener causes build error on requestLocationUpdates, is my understanding of interfaces incorrect?
Google Wallet in app transaction between users
Prevent Recyclerview from intercepting scroll/touch events
Why cant i use both test artifacts in Android studio?
Android - capture exactly what the screen displays (video/stream) - save it as image on device
Hide close button in android Search View
Can't send file to my phone with fastboot through ADB
Android Unable to write mifare ultralight tag - Not an Ndef Tag?
Change TintList for StateListDrawable inside RippleDrawable
ListView (height) inside DrawerLayout doesn't fill the screen

Categories

HOME
phantom-dsl
localization
api
telegram
css3
case
yahoo-finance
oracle-apex-5
shiro
r-googlesheets
alarm
yandex
carousel
google-apps
x264
nuget-package
crystal-lang
vert.x
okhttp
pattern-matching
owin
windows-ce
datastage
dynamic-sql
sse
microsoft-ocr
googlebot
href
monit
stackexchange
ntp
magento-1.8
scrollview
xbox
anki
dst
r-grid
installscript
imx6
reason
google-earth-engine
nohup
health-monitoring
movilizer
plr
drupal-theming
apache-directory
nanoc
xbmc
insight
lightning
x-ray
payara-micro
skin
oozie-coordinator
mach-o
mouseleave
autosar
xcode-server
ng-grid
shopping
data-protection
boost-serialization
false-sharing
realsense
cycle2
linklabel
iokit
fiware-monitoring
kubuntu
at-job
execve
beatsmusic
punycode
kissfft
memset
decoupling
dsym
twitter-bootstrap-rails
conditionaltagsupport
getopt
accesscontrolexception
windows-embedded-standard
android-usb
ie8-compatibility-mode
oocss
observium
epiceditor
octal
twisted.web
argouml
window-decoration
cross-database
eclipse-marketplace
interop-domino
sifr3

Resources

Encrypt Message