Reputation: 2980
I am trying to run a simple Xamarin UI test. I have already set ANDROID_HOME variable but test still throw exception (see image). I am using Microsoft Visual Studio Professional 2019 Version 16.8.1. Path of my android sdk is C:\Program Files (x86)\Android\android-sdk. I have installed platfroms since 25...
EDIT I made changes in user variables (add also a JAVA_HOME variable). Still not work. (see image).
EDIT 2 RESOLVED The problem was that i have multiple paths in ANDROID_HOME variable (as Cheesebaron mentioned in the comments). There is a variable in System variables called "Path" (which i didn't notice) that you need to modified and add %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools. In the same way you have to add JAVA_HOME variable (as in Junior Jiang answer).
Upvotes: 0
Views: 145
Reputation: 12723
If you are using visual stuido in PC.
First, you need to add ANDROID_HOME in User variables:
Second, also need to add following path inside Path:
Last, save changed and close visual studio to reopen it to check whether it works.
======================update======================
Have a try add JAVA_HOME in User variables:
and add following path inside Path:
Upvotes: 1