Unable to run the android app in VS2015

sivarlsivarl INMember ✭✭

Trying to run a android project in VS2015 in a simulator and got this in the output.

A numeric comparison was attempted on "$(_DeviceSdkVersion)" that evaluates to "" instead of a number, in condition "$(_DeviceSdkVersion) >= 21".

«1

Posts

  • AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

    Just ran into this exact same problem as well attempting to debug on a MI Pad 2 Android device. Is there a solution for this?

  • DavidMiddletonDavidMiddleton CAMember

    I'm getting this too.

  • DavidMiddletonDavidMiddleton CAMember

    A little more info: I started experiencing this problem as soon as I upgraded to the latest version of Xamarin.iOS and Xamarin.Android (4.1 - June 8, 2016).

    What "solved" it for me was to downgrade back to Xamarin.iOS and Xamarin.Android 4.0.4 (May 16, 2016).

    I hope this helps.

  • FabioCozzolinoFabioCozzolino ITBeta, University ✭✭✭

    Same problem here! Visual Studio 2015 with Xamarin 4.1.0.530 (Xamarin.Android 6.1.0.71).

  • AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

    Another data point. The error went away when I changed the "Minimum Android to Target" from 4.0.3 to 4.1. Not sure why this would manifest itself as the error we've been seeing.

    But what's really interesting, somewhat, is when I changed it back to 4.0.3, I no longer got the error. It appears something got jarred.

  • sivarlsivarl INMember ✭✭

    I was able to get it finally to build and run Android project in Visual Studio 2015.

    The solution in my case was to remove and install a fresh Android SDK.

    And also please update the SDK to the latest API level.

    Make sure the SDK path is correctly assigned in VS2015. (Tools -> Options -> Xamarin(Side menu) -> Android).

    Hope this helps!

  • VolodymyrSavchenkoVolodymyrSavchenko UAMember ✭✭✭

    Today i updated "Android support repository| and get this error. Now i has revision 33 and can't deploy it neither to emulator, nor to device.

  • FabioCozzolinoFabioCozzolino ITBeta, University ✭✭✭

    Hi @VolodymyrSavchenko, any of the workarounds listed in this thread works for you?

  • VolodymyrSavchenkoVolodymyrSavchenko UAMember ✭✭✭

    @FabioCozzolino said:
    Hi @VolodymyrSavchenko, any of the workarounds listed in this thread works for you?

    Nope. VS2013 says, that build and deploy was successful, but application don't appearing on device or emulator.
    Strange.

  • VolodymyrSavchenkoVolodymyrSavchenko UAMember ✭✭✭
    edited June 2016

    Mine problem was not in SDK, but in line, which i removed:

    namespace LayeredArchitecture.Droid
    {
    [Activity(Label = "App2", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = > ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

    There wasn't interface at all without that activity call.

  • AbhimanyuSinghalAbhimanyuSinghal INMember ✭✭
    edited June 2016

    Getting the exact same error. I also recently updated to latest stable release. Xamarin 4.1.0.530 and this issue has surfaced.

  • Woody712Woody712 GBMember ✭✭

    Same problem here. I thought we were past the 'every release breaks something fundamental' phase of xamarin.

  • Woody712Woody712 GBMember ✭✭

    I fixed this by having to do all of the following

    • Downgrading to Xamarin.VisualStudio_4.0.4.4.
    • Uninstalling Build Tools 24
    • Installing Build Tools 23.0.3
    • Swearing and crossing fingers
  • GrounchGrounch USMember

    Had the same error today, i guess it's after an update because yesterday everything went fine.
    Uninstalling Build Tools 24 and keep the 23.0.3 does nothing.
    Changing target android version in project properties does nothing.
    I doubt i can instal a previous version of Xamarin because it's an installer which download the last version...
    What the hell is wrong with it? Updates are supposed to solve issues, not create other ones right..?
    So i don't really know what to do, should i uninstal/reinstal everything from scratch? And loose like 5h?

  • What should i do : (

  • FabioCozzolinoFabioCozzolino ITBeta, University ✭✭✭

    Hi guys,
    downgrade back to Xamarin.Android 4.0.4 works for me!
    Check this guide: https://kb.xamarin.com/customer/portal/articles/1699777-how-do-i-downgrade-to-an-older-version-

    Fabio

  • KeiichiKobayashiKeiichiKobayashi USMember
    edited June 2016

    Maybe you can find "adb" failure log above the log which contains "_DeviceSdkVersion" error.
    The adb failure is important and would be the cause of the problem.

    The adb command would be like "...\adb.exe ... shell getprop ro.build.version.sdk" and you can try the command manually in command prompt by copy-paste so as to see the details about the adb failure.
    The information you could see would help you.

    This is my article about the problem and the solution. Sorry but it's written in Japanese.
    http://blog.clock-up.jp/entry/2016/06/20/xamarin-android-device-sdk-version-error

  • @ChristopherAmos
    Great.
    I had to adopt your way.
    Your way changing genymotion settings naturally solved the problem and it's smart.

    My way overriding adb was not smart, it's mad.
    And I'll rewrite my article soon.

    Thank you!

  • KevinAndersonKevinAnderson USUniversity

    I also have this issue. It started after updating to Xamarin Cycle 7. I can normally resolve it by closing Visual Studio, deleting the bin and obj folders, re-opening, and then doing a clean/rebuild of solution.

  • ahmadmadiahmadmadi USMember ✭✭✭

    I got this problem when I installed some packages using the android sdk manager . However the problem got solved when I installed the latest Xamarin Universal Installation (i.e. the official installer from Xamarin) . It detected that i have some stuff missing. After the installation was done , things went back to normal again .

  • IgorStrekhaIgorStrekha USMember ✭✭

    I got this problem

  • MichelangeloFrancoMichelangeloFranco ITUniversity ✭✭

    Me too, same problem here

  • VietSonNguyenVietSonNguyen USMember

    Same problem....
    It s 2 days I tried with Xamarin but it doesn't work...

  • KeiichiKobayashiKeiichiKobayashi USMember
    edited June 2016

    All of you, try to see not only _DeviceSdkVersion line but also at least previous 3 lines in log window.
    And I'd like to see your each logs. Please paste them here.

    I guess most of your problems would be caused by adb error.
    http://enblog.clock-up.jp/entry/2016/06/26/xamarin-android-device-sdk-version-error

  • FrancescoDAmatoFrancescoDAmato ITMember

    Hi
    I have the same problem with VisualStudio 2013 and VisulStudio 2015
    I have to give the customer this week, Xamarin solve the problem as soon as possible!

  • FrancescoDAmatoFrancescoDAmato ITMember

    Hi
    I have the same problem with VisualStudio 2013 and VisulStudio 2015
    I have to give the customer this week, Xamarin solve the problem as soon as possible!!

    Attach log

  • KeiichiKobayashiKeiichiKobayashi USMember
    edited June 2016

    Thanks for attaching log.
    You can see more detailed causes by running adb command manually.
    Try to do C:\....\platform-tools\adb.exe -s 192.168.202.101:5555 shell getprop ro.build.version.sdk in command prompt. (It's only your @FrancescoDAmato case.)
    Then you can see the actual causes of the error.

    If you find the error such as "adb server version (32) doesn't match this client (36)", you should check whether there are different versions of adb in your environment.

  • JavierGalvanJavierGalvan USMember

    @KeiichiKobayashi said:
    All of you, try to see not only _DeviceSdkVersion line but also at least previous 3 lines in log window.
    And I'd like to see your each logs. Please paste them here.

    I guess most of your problems would be caused by adb error.
    http://enblog.clock-up.jp/entry/2016/06/26/xamarin-android-device-sdk-version-error

    Watchout! This works! You have to set the same sdk path as much for VisualStudio as for the Emulator (Genymotion).
    Thank you all!

  • FrancescoDAmatoFrancescoDAmato ITMember

    Thank Keiichi Kobayashi and JavierGalvan

    I solved the problem by following your instructions

  • AOCT.08AOCT.08 USMember

    @ChristopherAmos said:
    the solution is to set the path of your android_sdk in genymotions settings. genymotion is using its own out of date version of adb.

    @ChristopherAmos That solved my issue. Thanks!

  • felipegamafelipegama USMember
    edited June 2016

    and lamentable. but for me it did not work attempting to put the way of the android and genymotion.

    anyone have any other suggestions?

  • wallymwallym USInsider, Beta ✭✭✭

    The genymotion fix did not work for. Going back to the previous version of Xamarin for Windows solved it. Thanks for the suggestions! Very helpful!

  • GrounchGrounch USMember

    It worked doing all that have been said:
    Set right adb path for genymotion
    Remove SDK Build 24 in the manager
    Set Android 6.0 for "compile using android versiuon" and not "use lastest platform.

  • CodingGfxCodingGfx MAMember

    The solution is simple just change the adb in genymotion to you own sdk
    solution in video :

  • MichaelChengMichaelCheng SGMember ✭✭
    edited July 2016

    .

  • m.shanim.shani ALMember

    Same thing occurred to me on fresh installation. I will try the downgrade

  • mveroukismveroukis CAMember ✭✭✭

    ChristopherAmos, I think you got it. I too came to the same conclusion. What tipped me off is that I tried to list all the Android devices on the console using the following command: adb devices

    M:\>adb devices
    List of devices attached
    adb server version (32) doesn't match this client (36); killing...
    error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
    could not read ok from ADB Server
    * failed to start daemon *
    error: cannot connect to daemon
    

    Then I noticed that Genymotion has the option to use either it's own adb or the one from your SDK. Choosing the SDK version made the difference and I'm now able to list devices in the console AND the weird DeviceSdkVersion error has gone away as well.

  • lolo_houselolo_house ESMember ✭✭

    hello, I have solved using genymotion
    in VS2015 and genymotion
    It is easy:
    genymotion in settings-> ADB have selected the same sdk that I have in VS2015 and it works.
    I hope you like

  • GamboltGambolt USMember

    Hi guys. Killing of shuame_helper process helps to me...
    this process raising every time you connect your device to PC and it takes Tcp-port nessesary to poll device...

Sign In or Register to comment.