Cannot run XAMARIN UI TEST on xamarin.forms, error System.Exception
Y Nakamura's answer moved me in the right direction but it still took me a long time to solve because I wasn't sure exactly what I was trying to solve. I'm going to expand on the answer here in case others run into the same problems that I did.
As mentioned, the problem seems to be caused by the files (not sure if it's adb.exe or other files) inside of platform-tools not being supported by Xamarin.UITest. platform-tools can be found in C:\Program Files (x86)\Android\android-sdk
I had platform-tools folder, plus two additional folders with old12341234 suffixes (the numbers didn't make any sense to me).
To figure out which version of adb.exe is in each folder:
- Open one of the folders
- Hold shift and right-click in the windows explorer window to see the Open PowerShell window here option
- In PowerShell, run the command
./adb.exe version
to see the version number you are running
In my case, the version that was too new was 1.0.40. I found a folder that had 1.0.39. I renamed the platform-tools folder that was too new to platform-toolsTooNew. I then renamed the folder that contained adb.exe v 1.0.39 to platform-tools, then restarted Visual Studio.
After doing all of that, my automated tests once-again worked!
Update November 2020
I was able to run with a newer version of ADB, but I had to delete the old folder from my android-sdk folder. I am using:
- ADB version 1.0.41
- Visual Studio 16.6.5
- Xamarin 16.6.000.1064
- Xamarin.Android SDK 10.3.1.4
I'll keep my original post above in case it helps others.
If you have the same error, check in our sdk directory if you have platform-tools and platform-tools.oldxxxx, delete old ! Just work after