Xamarin.Android Projects failed to deploy in visual studio emulator for android

arminrasoulianarminrasoulian USMember
edited March 2016 in Xamarin.Android

Hi,

I'm using visual studio 2015 update 1 with windows 10 build 10586 TH1.

also I'm using Xamarin Version 4.0.1.96.

I have created a blank Xamarin.Forms app. It deploys to Windows Phone emulators without any issue. But unable to deploy to Android Emulators.

When I start android project Android Emulator launched successfully but visual studio freeze at this step.

I've tried a lot of android emulator profiles but cannot solve the problem.

This problem only exists for Emulators and project successfully deployed on physical android device.

I have the same issue with Xamarin.Android projects.

Here is all of the text in output window:

1>Starting deploy 4.5" KitKat (4.4) HDPI Phone ...
1>Starting emulator 4.5" KitKat (4.4) HDPI Phone ...
1>Validating emulator arguments...
1>Determining if emulator is already running...
1>Preparing virtual machine...
1>Launching emulator...
1>Emulator launched successfully

Thank you in advance for your help.

Answers

  • AnewilAnewil PLMember

    I have the same problem. Any solutions?

  • TylerTerrellTylerTerrell USMember

    Using the new Xamarin addin for Visual Studio, created a blank project and deployed it to the Android emulator. Emulator loads fine and then nothing happens. App is not deployed. No errors. If I stop the emulator, it tells me deployment failed.

  • CsabaFabianCsabaFabian USMember ✭✭

    I was having the same problem, running Visual Studio as Administrator solved the issue.

    It is a bit scary that in two months there was no reaction from Xamarin to this issue, though!

  • taka_219taka_219 USMember

    I'm having the same problem.
    Running Visual Studio as Administrator couldn't solve the issue.
    But I could deploy and debug my app by launching VS Emulator for Android manually before deploying.

  • TopherJohnsonTopherJohnson USMember ✭✭

    I am having this problem for the past month or so. adb devices shows the emulator is connected.

    VS is running as administrator.

    The only way I can get the app deployed is to cacnel the build after the emulator has launched, and then deploy again. This used to work. What's the problem?

  • CodyBCodyB USXamarin Team Xamurai

    Hey,

    Thanks for the reports. Most likely based on your reports, it is one of two potential items:

    Either the following issue, which impacts users with Skylake level Intel processors: https://bugzilla.xamarin.com/show_bug.cgi?id=42859

    Or the following issue, which occurs when the SDK set within the Windows registry does not match the SDK within Visual Studio: https://msdn.microsoft.com/en-us/library/mt228282.aspx#Anchor_8

    Please let me know if it is either (or neither) of those issues.

    Thanks!

  • JayNJayN USUniversity

    I was facing a similar issue! Hitting the Run button in VS did not deploy the app to the emulator. I could get around this by right clicking on the project and selecting the Deploy menu option.

  • VegasJVegasJ USUniversity ✭✭

    Editing the registry fixed this issue for me.

  • NailaNawazNailaNawaz PKMember

    @JasonVerLinden can you please explain your solution.

  • FordFord CAMember

    @QuocLeTranMinh said:
    This is my solution:

    Check Android SDK path in Visual studio: Tools-> Options -> Xamarin -> Anroid Settings: Android SDK Localtion

    goto regedit : HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools change path as above. Restart Visual Studio and enjoy

    This fixed the issue for me.

  • @CodyB's registry solution worked for me.

    A recent update to Xamarin changed my registry key and I had to redo this change.

  • tipektipek USMember

    @RyanQuocLe said:
    This is my solution:

    Check Android SDK path in Visual studio: Tools-> Options -> Xamarin -> Anroid Settings: Android SDK Localtion

    goto regedit : HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools change path as above. Restart Visual Studio and enjoy

    Registry fixed this issue for me. Thanks for the solution.

  • VivekArzareVivekArzare USMember

    I have same problem. I was update xamarin in vs 2015 after then create android app it is show "Could not find or load main class mono.android.AndroidDesignerHost" Connection to the layout renderer failed. Please help me out.

  • MarkBabaylanMarkBabaylan USMember

    I have tried fixing the registry and running as admin. Still no luck though

  • Vijay.5883Vijay.5883 USMember

    @MarkBabaylan said:
    I have tried fixing the registry and running as admin. Still no luck though

    Hi Mark.,

    After update the registry key do the following. This will solve the issue. It's worked for me. I am using VS2017.

    1. Open Hyper-V Manager and select the VM for the emulator profile that your are using.
    2. Select Delete Saved State (lower right).
    3. Choose Settings...
    4. Expand the processor node and choose Compatibility.
    5. Enable Migrate to a physical computer with a different processor version.
    6. Restart the service (under Actions) and try again.
  • JohnOkoroaforJohnOkoroafor USMember ✭✭

    if you're also having this issue and cant find the registry folder in your registry, run this command in an elevated CMD:

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools" /v Path /d %localappdata%\Android\sdk

    Then restart your emulator. worked for me.

  • ArunPrasad.007ArunPrasad.007 USMember

    @RyanQuocLe said:
    This is my solution:

    Check Android SDK path in Visual studio: Tools-> Options -> Xamarin -> Anroid Settings: Android SDK Localtion

    goto regedit : HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools change path as above. Restart Visual Studio and enjoy

    This solution perfectly worked for me. Thank you very much for the answer.

  • luizpcamluizpcam BRMember

    Yeah! @JohnOkoroafor works for me! But stops on this line: 1>C:\Program Files (x86)\Android\android-sdk\build-tools\25.0.3\zipalign.exe 4 "D:\luizp\Documents\dev\geracaoagro\com.lpcdev.geracaoagro.gbp\gbp\gbp.Android\bin\Debug\com.companyname.gbp-Signed-Unaligned.apk" "bin\Debug\com.companyname.gbp-Signed.apk"

    What im doing wrong?

    tks

  • TrevorBalcomTrevorBalcom USMember ✭✭

    @luizpcam said:
    Yeah! @JohnOkoroafor works for me! But stops on this line: 1>C:\Program Files (x86)\Android\android-sdk\build-tools\25.0.3\zipalign.exe 4 "D:\luizp\Documents\dev\geracaoagro\com.lpcdev.geracaoagro.gbp\gbp\gbp.Android\bin\Debug\com.companyname.gbp-Signed-Unaligned.apk" "bin\Debug\com.companyname.gbp-Signed.apk"

    What im doing wrong?

    tks

    That's a bug in Xamarin with Visual Studio 2017. When it gets to this point you can cancel the build then run it again and it should work the second time. You will have to do this once after every reboot.

Sign In or Register to comment.