Andiana
Andiana

Reputation: 1952

Visual Studio 2015 Xamarin deploy fail without any error message

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?

Upvotes: 28

Views: 38617

Answers (21)

ajd.nas
ajd.nas

Reputation: 404

Just run your Visual studio as Administrator mode.

Upvotes: 1

penCsharpener
penCsharpener

Reputation: 449

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.

Upvotes: 0

Jamezuh
Jamezuh

Reputation: 131

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

Upvotes: 0

FreakyAli
FreakyAli

Reputation: 16562

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

Upvotes: 0

Curiosity
Curiosity

Reputation: 1931

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

Upvotes: 0

Ardenne
Ardenne

Reputation: 927

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

Upvotes: 0

Neelam Prajapati
Neelam Prajapati

Reputation: 3802

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

Its worked for me!

Upvotes: 2

ndarriulat
ndarriulat

Reputation: 869

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

Upvotes: 0

Colin Calvat
Colin Calvat

Reputation: 1

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://stackoverflow.com/a/32564067/7505268 That solved it for me.

Upvotes: 0

Ivo Krugers
Ivo Krugers

Reputation: 13

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

Upvotes: 1

Shantu
Shantu

Reputation: 145

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.

Upvotes: 0

Pavel Vanecek
Pavel Vanecek

Reputation: 11

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.

Upvotes: 1

Peter
Peter

Reputation: 1302

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).

Upvotes: 0

Alican Uzun
Alican Uzun

Reputation: 349

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

Upvotes: 0

Fragment
Fragment

Reputation: 1585

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.

Upvotes: 4

Clint StLaurent
Clint StLaurent

Reputation: 1268

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

Upvotes: 0

csha
csha

Reputation: 9614

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

Upvotes: 15

mohammad jaber
mohammad jaber

Reputation: 71

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.

Upvotes: 7

Andiana
Andiana

Reputation: 1952

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.

Upvotes: 1

Ali Seyedi
Ali Seyedi

Reputation: 1817

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.

Upvotes: 2

userb00
userb00

Reputation: 599

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

Upvotes: 18

Related Questions