Visual Studio 2015 Xamarin deploy fail without any error message
Asked Answered
P

21

28

I just installed VS 2015, the installation was finish (after some fail time caused by the slow network, I run setup again).

I create a project as Android > Android blank project When I press F5, the build is seem to by success but the deploy is fail, there isn't error message. Tried set Tool->Option->Build->Diagnostic, no result. VS 2015 is pretty new, is anyone met this? How can I fix this?

Pulsifer answered 29/7, 2015 at 5:11 Comment(8)
look at the output window and select "Debug" from the dropdownWelltodo
Just to be sure: Did you try a Build - > Clean (or rebuild) of your solution?Folkway
@thumbmunkeys, I can't see any "Debug" in dropdow of Output windowsPulsifer
@DanielVeihelmann, yes I tried clean and build, but it isn't fail on build, it fail on DEPLOY!Pulsifer
You've probably figured this out or moved on by now, but I just ran into this and it turned out to be because I hadn't selected a valid Android emulator for my Android project. There was a line in the Output window that said "Please select a valid device before running the application", which for some reason wasn't shown in the Error List.Healey
@MagnusGrindalBakken where can you select the device?? I have an emulator running and I have looked in the project options, etc.Scotism
@mobibob, Hi, if you are new with Xamarin, I suggest installing "Xamarin for Visual studio". VS2015 installer is not enoughPulsifer
I tried all the above mentioned solutions, but what worked for me was to use my physical android device for debugging and that worked.Pivotal
E
18

I bumped into the same, but I started VS2015 as Administrator and solved the problem.

Einkorn answered 23/12, 2015 at 21:4 Comment(1)
@OmarRehman try updating xamarin (Properties - Xamarin - Other), that worked for meLymphoid
S
15

Is any Android Virtual Device running?


  1. Open AVD menu
    AVD icon

  1. Launch the device
    enter image description here

  1. Wait for it to fully load
  2. Build and deploy
  3. Find your app in device's menu and execute it
Sampler answered 20/8, 2016 at 9:53 Comment(3)
Don't quite understand why pressing 'play' in Visual Studio, emulator loads, and then the deploy fails ... where as this solution works - just 'preloading' the emulator fixes it. Strange.Elul
@lan Does the emulator really start? In my case it didn't and the deploy failed because there was no running emulator. But if it really does start, my guess would be that either it starts with wrong parameters or VS tries to deploy before the emulator fully loads. Android has to be booted up and ready before deploying apps!Sampler
This solved it for me. I had to manually start the emulator in order for deploy to succeed. Thank you!Jujutsu
M
7

Visual Studio gets stuck trying to deploy the app to the emulator or the emulator does not appear as a debug target in other IDEs

If the emulator is running, but it does not appear to be connected to ADB (Android Debug Bridge) or it does not appear in Android tools that make use of ADB (for example, Android Studio or Eclipse), you may need to adjust where the emulator looks for ADB.

The emulator uses a registry key to identify the base location of your Android SDK, and looks for the \platform-tools\adb.exe file under that directory. To modify the Android SDK path used by the emulator:

Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK.

Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools in the folder tree on the left.

Modify the Path registry variable to match the path to your Android SDK.

Restart the emulator and you should now be able to see the emulator connected to ADB and associated Android tools.

Mcgaha answered 29/6, 2016 at 0:41 Comment(0)
S
4

And yet another recipe of fixing this:

  • clean projects
  • remove all bin, obj folders
  • mark your android-project as startup

then try to deploy again

As for me, in some cases, if visual studio stucked on project building, it requires pc reboot.

Sidhu answered 21/10, 2016 at 10:21 Comment(0)
P
2

I had the same annoying issue. Going to Options -> Xamarin -> Android Setting and checking Preserve application data/cache on device between deploys solved my problem.

Palais answered 10/7, 2016 at 5:32 Comment(0)
E
2

I was facing same issue. Just reopen visual studio and rebuild your project..and then try to deploy.

Its worked for me!

Emlen answered 22/8, 2016 at 11:42 Comment(0)
P
1

According to Magnus Grindal Bakken's comment, I found the solution.

1) The installation must have an internet connection to be completed. Any interruption may cause components to be excluded.

2) You need android emulator. Installing the Android SDK and Visual Studio 2015, is not sufficient, You either need the Microsoft emulator, the android one or another third party emulator (like Genymotion). You also need to ensure that the Xamarin plugins for Visual Studio are installed.

Xamarin for Visual Studio can be downloaded here. Once it is installed Visual Studio will be able to create and run Xamarin projects. Xamarin for VS includes the Xamarin Player for emulation. I think it's even better than Genymotion.

Pulsifer answered 5/4, 2016 at 0:33 Comment(0)
I
1

Start emulator via AVD manger ... [start] button (as user m93a suggested).

And next option contains check option "wipe user data". Check it !

It helps me solve this problem. Then deploy or debug the application and all process will works as expected.

Incline answered 1/12, 2016 at 13:34 Comment(0)
K
1

I had the same problem with my XF App, it didn't deploy and just one message saying Deployment Failed, internal error....

I solved it. Working on Mac with Xamarin Studio, make sure that the ABI of your simulator is supported by your app.

Xamarin Studio Android project Options

Ku answered 9/1, 2017 at 12:28 Comment(0)
O
1

Just run your Visual studio as Administrator mode.

Oreopithecus answered 19/3, 2021 at 8:39 Comment(0)
A
0

Sometimes the physical Android device gets confused about versions.

On the device, to go settings | Applications Manager | All applications.

Manually delete your application. Manually delete "Mono Shared Runtime" (don't worry it will reinstall during deploy)

Make any change in your project so it is seen as altered and needing to be recompiled: Add a new blank-line to a .cs file or something.

Build Debug/deploy

Aspirator answered 7/10, 2016 at 17:45 Comment(0)
H
0

I faced that problem couple hours ago, I tried to deactivate hyper-V and it worked for me.

Hebetate answered 9/11, 2016 at 10:10 Comment(0)
C
0

In the Android App project Properties in Visual Studio I had to go to Android Options>Advanced and make sure the Support architectures had the architecture of my AVD checked.

In my case this was x86_64 (which, by the way, does not have a particularly discovereable method of installation - took me days).

Crofoot answered 12/11, 2016 at 13:51 Comment(0)
S
0

First of all, we can find the error in "Details" when we click "Start" button on "AVD Manager" for "Android_Accelerated_x86". If the error is as follows :

Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAXM is not installed on this machine

So, in this case we need to install "Intel® Hardware Accelerated Execution Manager". It can be downloaded from following link :

haxm-windows_v6_0_6.zip (6.0.6)

Note: After installing Xamarin for the first time in visual studio 2015 i had the same error to run "Android_Accelerated_x86". After installing this accelerated emulator is now up and running.

Salve answered 8/1, 2017 at 2:11 Comment(1)
Does this apply to AMD systems too?Riggs
J
0

If the emulator does not even lauch, maybe deploy is skipped. You cas see this in the output console. If so, you may have to activate the deploy by checking it in the solution's (not project) parameters.

If the emulator launches but the deploy won't end after minutes, with no error, try the steps described here : https://mcmap.net/q/503751/-app-not-run-in-visual-studio-emulator-for-android-in-visual-studio-2015 That solved it for me.

Jaundice answered 2/2, 2017 at 16:6 Comment(1)
Welcome to Stack Overflow! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.Whitver
A
0

I had Xamarin Android Player opened while trying to deploy the Android project. This steps worked for me:

  1. Closed Xamarin Android Player
  2. Ran Android project again
Aftmost answered 6/3, 2017 at 22:10 Comment(0)
W
0

in my case I had this problem because "Solution Configuration" was set to Release. I change it back to Debug and I solve the problem

Wavelength answered 11/7, 2017 at 23:34 Comment(0)
F
0

Try one of the following and see if you can get the app to deploy to your device.

  • Clean and build project/solution
  • Make sure you have updated all the NuGet packages (Right click on solution and click on Manage NuGet Packages.... Then check in Updates section whether there are any updates)
  • Make sure you have installed all the necessary SDKs from the Android SDK Manager
  • Check whether you have selected the correct project as the startup
  • Check if you have set the correct path for Android SDK and NDK locations
  • Make sure you have checked Deploy for your selected project from Build -> Configuration Manager
Fenny answered 6/9, 2017 at 9:18 Comment(0)
D
0

Well there can be many reasons,one of them could be that from the Build section in your toolbar,if you check the configuration manager there will be project names that are available in your current solution all you have to check is if the deploy checkbox is checked or not.If not kindly check it and things will work just fine

Downer answered 7/9, 2017 at 9:49 Comment(0)
D
0

This worked for me:

  • Making sure that Define DEBUG constant is checked.

enter image description here

  • Using Log.Info("yourTag-AnyString", "Error before/after ");

            protected override void OnCreate(Bundle bundle)
            {
                base.OnCreate(bundle);
    
                // Set our view from the "main" layout resource
                Log.Info(tag, "Error before Layout");
                SetContentView(Resource.Layout.Main);
    
                // Get our button from the layout resource,
                // and attach an event to it
                //Button button = FindViewById<Button>(Resource.Id.MyButton);
    
                //button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
                Log.Info(tag, "Error before variables");
                userName = FindViewById<EditText>(Resource.Id.editTextUsername);
                password = FindViewById<EditText>(Resource.Id.editTextPassword);
                btnInsert = FindViewById<Button>(Resource.Id.btnInsert);
                Log.Info(tag, "Error after variables");
                btnInsert.Click += BtnInsert_Click;
            }
    
  • changing emulators or exporting the signed .apk instead

  • For android apps, using android device logging

Dimity answered 21/10, 2017 at 23:20 Comment(0)
P
0

There is actually a connection between running Visual Studio as administrator and setting the registry path.

I followed the instructions here but it only worked after running VS as admin because my Android SDK path is in "C:\Program Files (x86)". So in order to add or change files there you need admin rights. Alternatively you can change the permissions of the "Android" folder so that the group "Users" as full access. This worked for me as well.

Or you make sure you don't even install the Android SDK in "C:\Program Files (x86)".

By the way I found that restarting VS, or even the Emulator again wasn't necessary after I added the registry key. It picks it up when it needs to.

Propel answered 7/1, 2018 at 0:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.