18

I want ton run Xamarin UI test, but when i run the test i have this error :

System.Exception : 'The running adb server is incompatible with the Android SDK version in use by UITest: 
C:\Program Files (x86)\Android\android-sdk

my start command-line : return ConfigureApp.Android.ApkFile("/Users/Jerem/source/repos/App4/App4/App4.Android/bin/Debug/com.companyname.App4-Signed.apk").StartApp();

Thanks for our helping

10
  • What android SDK are u using??
    – Woj
    Sep 10, 2018 at 9:57
  • @Woj I use SDK 27 Sep 10, 2018 at 10:29
  • What about Xamarin.UITest?
    – Woj
    Sep 10, 2018 at 10:46
  • Last version, 2.25.. for the nunit package, I did not touch it and I let the basic ones Sep 10, 2018 at 10:51
  • 2
    i find platform-tools.old****, i delete this Sep 10, 2018 at 11:56

3 Answers 3

26

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

1
  • I had to revert to the .old and remove the newer version. Nov 15, 2020 at 23:53
11

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:

  1. Open one of the folders
  2. Hold shift and right-click in the windows explorer window to see the Open PowerShell window here option
  3. In PowerShell, run the command ./adb.exe version to see the version number you are running Powershell adb version

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.

3
  • 1
    The versions are actually 1.0.40 and 1.0.39 rather than 1.40 and 1.39.
    – Caltor
    Feb 18, 2019 at 11:17
  • Thanks, I fixed it. Feb 18, 2019 at 17:28
  • 1
    Wish Xamarin.UITools would tell us which one it ACTUALLY wanted
    – Damian
    Jul 15, 2019 at 22:15
6

Android SDK Platform-Tools 28.0.0 (40) is too new. Try restoring 27.0.1 (39). Open folder %ANDROID_HOME%. If the folders platform-tools and platform-tools.oldxxxx appears, rename them to restore old version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.