问题
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 Adroid > 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?
回答1:
I bumped into the same, but I started VS2015 as Administrator and solved the problem.
回答2:
Is any Android Virtual Device running?
- Open AVD menu
- Launch the device
- Wait for it to fully load
- Build and deploy
- Find your app in device's menu and execute it
回答3:
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.
回答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.
回答5:
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.
回答6:
I was facing same issue. Just reopen visual studio and rebuild your project..and then try to deploy.
Its worked for me!
回答7:
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.
回答8:
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.
回答9:
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
回答10:
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
回答11:
I faced that problem couple hours ago, I tried to deactivate hyper-V and it worked for me.
回答12:
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).
回答13:
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.
回答14:
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.
回答15:
I had Xamarin Android Player opened while trying to deploy the Android project. This steps worked for me:
- Closed Xamarin Android Player
- Ran Android project again
回答16:
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
回答17:
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
回答18:
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
回答19:
This worked for me:
- Making sure that Define DEBUG constant is checked.
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
回答20:
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.
来源:https://stackoverflow.com/questions/31691644/visual-studio-2015-xamarin-deploy-fail-without-any-error-message