(If you prefer Japanese than English, you can see Japanese article.)
The environment in this situation
When I tried to launch a Xamarin application from Visual Studio, I saw an error that contains "$(_DeviceSdkVersion)" message. The details are as follows.
1>------ Build started: Project: App11, Configuration: Debug Any CPU ------ ... ... 3>C:\android-sdk-windows\build-tools\23.0.3\zipalign.exe 4 "c:\Projects\App11\App11\App11.Droid\bin\Debug\App11.Droid-Signed-Unaligned.apk" "bin\Debug\\App11.Droid-Signed.apk" 3>C:\android-sdk-windows\platform-tools\adb.exe -s 192.168.44.101:5555 shell getprop ro.build.version.sdk 3>"adb.exe" exited with code 1. 3>A numeric comparison was attempted on "$(_DeviceSdkVersion)" that evaluates to "" instead of a number, in condition "$(_DeviceSdkVersion) >= 21". 3>Build FAILED. 3> ========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Seeking the cause of the problem
First, I tryied to find some tips by googling "_DeviceSdkVersion" keyword and I failed. Then I think this keyword would be only a private symbol name in Xamarin or other engine.
We should look not at "_DeviceSdkVersion" line but at the previous line "adb.exe exited with code 1."
This error tells us that adb command had failed by something bad. We can find the adb command line string above the line "adb.exe exited with code 1."
In this case, the adb command line is as follows. (It depends on each environment)
C:\android-sdk-windows\platform-tools\adb.exe -s 192.168.44.101:5555 shell getprop ro.build.version.sdk
I tried to run this command in command prompt manually. The result was as follows.
> C:\android-sdk-windows\platform-tools\adb.exe -s 192.168.44.101:5555 shell getprop ro.build.version.sdk adb server version (32) doesn't match this client (36); killing... * daemon started successfully * error: device '192.168.44.101:5555' not found
This error tells me that there is adb protocol error.
In other words, there are different version of adb which are launched.
It's the actual cause of the problem I wanted to know.
One of the actual causes: Genymotion
The solution is simple. We must not use different version of adb. That's all.
Why do I or you use different version of adb???
Use same adb between Xamarin.Android and Genymotion
My problem was solved by this way. Good luck.
Last, dear English natives
I'm Japanese and my English sentences may often include bad expressions.
Please feel free to point out any mistakes in my articles if you notice.