Why no official developer reply to this issue ? I have tried all the solutions posted here without any success, I have to close visual studio every 1 or 2 builds to be able to deploy!
Inconsistent Deployment Errors
I am attempting to create a Xamarin.Android app using Visual Studio 2022 Version 17.1.0. I inconsistently (even if I have not changed any code or configuration) receive the following error:
There were deployment errors. Continue?
The Output window gives no useful information, so I have no idea where to look for more information on the problem. I have not found anything online that seems to help. I am having this problem on the following devices (and I probably would on others as well):
Emulator in Visual Studio 2022
Surface Duo
Samsung Galaxy S10e
What is the problem?
Xamarin
-
martinsmith 6 Reputation points
2022-02-22T23:24:50.033+00:00 I also get this issue after updating to the latest. For each deployment, I have to close VS and reopen it. A very annoying issue, please prioritize it. Thanks.
Microsoft Visual Studio Professional 2022
Version 17.1.0
VisualStudio.17.Release/17.1.0+32210.238
Microsoft .NET Framework
Version 4.8.04084Installed Version: Professional
Xamarin 17.1.0.309 (d17-1@3f96c58)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.Xamarin Designer 17.1.0.87 (remotes/origin/main@d50fb5635)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.Xamarin Templates 17.1.8 (590388a)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.Xamarin.Android SDK 12.2.0.4 (d17-1/19b97b7)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: a5d1934
Java.Interop: xamarin/java.interop/d17-1@7ac33610
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.37.1@0893b3b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-1@db125a7Xamarin.iOS and Xamarin.Mac SDK 15.6.0.3 (caa899d24)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. -
JarvanZhang 23,951 Reputation points
2022-02-23T05:51:16.037+00:00 I inconsistently (even if I have not changed any code or configuration) receive the following error
Hi, njsokalski. Try to factory reset the emulators or clean and rebuild the project. This may be a potential issue with the update of VS, it's suggested to report the issue to VS product team. Please see How to report a problem with Visual Studio - Visual Studio | Microsoft Learn
-
Nathan Sokalski 4,116 Reputation points
2022-02-23T21:01:00.503+00:00 I am pretty sure the problem is not the emulator, because (as I mention above) it happens on my physical devices as well. I have tried cleaning & rebuilding the project, but that does not make any difference. I have not tried doing a factory reset on the emulator, although that is obviously not something I would want to do on my physical devices. I will take a look at reporting the problem, although it seems like a somewhat generic question, since I don't have a lot of detail to give.
-
JarvanZhang 23,951 Reputation points
2022-02-24T09:09:18.59+00:00 Thanks for sharing the details. You could focus on the reporting thread for a solution.
-
Nathan Sokalski 4,116 Reputation points
2022-02-25T19:07:47.927+00:00 I have reported the problem, and it (extremely recently) has been reported. However, it has a request for more information:
https://developercommunity.visualstudio.com/t/Xamarin-deplyoment-to-android-fails-sile/1672810
However, I have never used the Device Log Tool or Debug Log Tool. I have found the Device Log Tool, but I could not find the Debug Log Tool (is that the same thing?). But I also was not sure how to attach the device log. Is there a file somewhere? I found lots of stuff on how to open the tool, but nothing on how to send the results or where they are saved. Are there any good pages on how to do this? Thanks.
-
Guanghua Xiong 6 Reputation points
2022-03-02T13:08:35.587+00:00 I have the same problem.
Reopen visual studio will temporarily suppress the problem but will reoccur after a while
If I restart visual studio, the problem will not happen for a while, below is the normal deploy output
-
John Mitchell 1 Reputation point
2022-03-06T20:55:11.94+00:00 I've just updated to 17.1.0 and am encountering the same issue. The only difference for me is that I get the deployment error, then I hit cancel and then run it again and it works. So for each build\deployment, I have to run it twice. This project worked successfully on a prior build (I cannot recollect the exact version I had prior to updating but it was something like 17.0.4/5 I believe)
-
Luke Pro 1 Reputation point
2022-03-19T17:02:58.61+00:00 Using VS2022 Enterprise 17.1.1, trying to deploy to Android 12 S emulator (app target and compile is also both Android 12), managed to fix by using Android SDK Command-line Tools (latest) 5.0 inside VS's Android SDKs and Tools window. If you open Android Device Manager in VS though, it will complain about that it can't find the command line tools - DO NOT ACCEPT THE PROMPT TO INSTALL THEM.
-
Max Payne 16 Reputation points
2022-03-23T05:27:06.757+00:00 Did they solve this in 17.1.2 ? I have the community edition and the error is very annoying!
-
Nathan Sokalski 4,116 Reputation points
2022-03-23T19:03:55.913+00:00 I'm assuming this was intended to be a comment (not an answer), but either way I will say that I do not believe it is fixed, because I have also installed the 17.1.2 update and am using the Community Edition and still receive the error. If it is fixed (although I do not believe it is), then there is some configuration that is very messed up, and I would like to know what it is & how to fix it. Losing the ability to use certain features (such as Undo) between every debug session makes it very hard to experiment with code.
-
MJMC 6 Reputation points
2022-03-23T20:08:40.493+00:00 This really is annoying! VS 2022 Community 17.1.2 ... every time i need debug after some time trow this error.
I need then close and open VS every time. -
Luke Pro 1 Reputation point
2022-03-23T20:23:28.353+00:00 Any luck by installing only the Android SDK Command-line Tools (latest) 5.0 inside VS's Android SDKs and Tools window?
If you open Android Device Manager in VS though, it will complain about that it can't find the command line tools - DO NOT ACCEPT THE PROMPT TO INSTALL THEM.
-
Nathan Sokalski 4,116 Reputation points
2022-03-24T01:26:21.617+00:00 Could you give more detail on exactly how to do what you suggest? I'm not sure what to do to install/uninstall/modify what you mention. I can obviously deny the request to install the command line tools, but what if they are already installed (I would guess they are, but I don't know for sure)? I don't know the exact details of my Android SDK installation, so I am not sure what I might need to change to solve this problem.
-
Max Payne 16 Reputation points
2022-03-24T02:05:05.997+00:00 I have 2 command line tools at the SDK window, both are v5 and both are 104MB in size, but one of them is marked as "latest", which one should be ticked ?
-
Luke Pro 1 Reputation point
2022-03-24T19:27:20.153+00:00 Uncheck/uninstall the non latest one
-
Luke Pro 1 Reputation point
2022-03-24T19:30:18.06+00:00 In the menu bar: Tools -> Android -> 'Android SDK Manager', which will bring up a window. In there select the 'Tools' tab, and under 'Android SDK Tools' make sure only 'Android SDK Command-line Tools (latest)' is checked (you may need to expand the 'Name' column to see the full name). The other one needs to be unchecked and uninstalled.
-
MJMC 6 Reputation points
2022-03-25T00:09:57.197+00:00 After try, uncheck 5.0 and check 5.0(lastest), the problem persist.
In the output window, debug section, can see this
"Build Error: Xamarin.Android does not support running the previous version. Make sure the solution is compiled before running or debugging it."
-
Melvyn Drag (HYTORC) 1 Reputation point
2022-03-25T14:44:42.68+00:00 Hi
Seems to be an issue with <queries> in the Android Manifest for me.
Same issue here as described by @Nathan Sokalski , and I get the same output as @Guanghua Xiong ! I have to restart visual studio for every debug session.
Just started noticing this problem today March 25th 2022, and I use VS everyday.
For me the problem started this morning when I added <queries> to my Android Manifest and added Xamarin.Essentials.Browser to my app.
If I remove those changes the app starts deploying fine again.
My manifest is pretty much lifted from the docs open-browser:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="25" android:versionName="3.1.4" package="com.foo.bar" android:installLocation="auto"> <queries> <intent> <action android:name="android.intent.action.VIEW" /> <data android:scheme="http"/> </intent> <intent> <action android:name="android.intent.action.VIEW" /> <data android:scheme="https"/> </intent> </queries> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="31" /> <application android:label="FOOBAR" android:allowBackup="false" android:extractNativeLibs="true"></application> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission ... et cetera </manifest>
Side note:
@Guanghua Xiong s project says BlueWifi. My project uses Bluetooth and Wifi. Is that the root of the problem? -
Nathan Sokalski 4,116 Reputation points
2022-03-25T17:44:34.66+00:00 I doubt that's my problem, because the only elements in my manifest file are uses-sdk & application (my app does not connect to the internet or use anything that requires special permissions like the camera or bluetooth).
-
Ian Hovenden 1 Reputation point
2022-03-28T00:14:58.033+00:00 I'm having the same issue with VS 17.1.2.
I have tried everything on-line and like the rest of the contributors here find myself having to restart VS. Some times it fails to go into debug mode as well :( -
Dalibor Markovic 6 Reputation points
2022-03-28T10:47:15.607+00:00 I'm having the same issue with VS 17.1.2
-
Andrew Aspden 1 Reputation point
2022-05-22T21:50:26.633+00:00 I was getting the same issues. I stopped the emulator and then factory reset it, then started it up. Then restarted the phone(not stopping the emulator, actual phone restart). Then I was able to deploy just fine
-
Shay Wilner 1,726 Reputation points
2023-03-23T18:52:30.7133333+00:00 Hello
same error too even using my physical device.
Sign in to comment
3 answers
Sort by: Most helpful
-
Max Payne 16 Reputation points
2022-03-26T05:25:28.123+00:00 -
Rob Caplan - MSFT 5,417 Reputation points • Microsoft Employee
2022-04-01T17:48:38.867+00:00 @Max Payne , there is no official developer reply here because Q&A is not a bug reporting site and isn't watched by the development team.
You'll get the best results by reporting bugs via the official reporting paths. See How to report a problem with Visual Studio - Visual Studio | Microsoft Learn
Doing so will let you get notice of updates and provide more details on your specific issue. Often times when people post symptoms on forums instead of in the feedback site multiple issues get jumbled together and lost - you might have a similar symptom to somebody else's problem, but with a different cause so the fix to the original problem doesn't apply and your unreported problem doesn't get addressed. Note that multiple people on this thread have reported different symptoms and so may not all be running into the same problem.
From the Q&A How to write a quality question FAQ:
Don't use this site to report product bugs or feature requests .This is a site for support, so please use the right site to requests new feature requests about a Microsoft product or report any bugs. This will ensure that the experts can focus on resolving user's problems instead of having to redirect you to the right site.
Sign in to comment -
-
Dalibor Markovic 6 Reputation points
2022-03-29T06:43:19.457+00:00 I installed Visual Studio LTSC 17.0 - 17.0.7 - March 8, 2022 - 17.0.32228.444, and everything works fine.
-
Nathan Sokalski 4,116 Reputation points
2022-03-29T16:03:10.393+00:00 What is LTSC? Also, are you suggesting downgrading to the versions you mention?
-
MJMC 6 Reputation points
2022-03-29T16:52:39.147+00:00 Apparently is this, you can download specific version for enterprise y professional, community dont have.
-
Dalibor Markovic 6 Reputation points
2022-03-30T05:08:59.597+00:00 Long term support version. Yes, until they fix bug. Better this than closing and reopening VS after every deployment (or cleaning bin and obj directories).
Here's the link about VS release rhythm: https://learn.microsoft.com/en-us/visualstudio/productinfo/release-rhythm. -
Dalibor Markovic 6 Reputation points
2022-03-30T05:15:38.723+00:00 Then downgrade to version it wokrs fine. I suggest you try 17.0.6 - February 8, 2022 - 17.0.32126.317
-
Dalibor Markovic 6 Reputation points
2022-03-30T05:16:19.717+00:00 17.1.0 has the same bug
-
MJMC 6 Reputation points
2022-03-30T17:08:04.11+00:00 Its the best fix for now, but for me that i use Community version, LTSC don't work :( You say delete bin and obj folder work?
-
Dalibor Markovic 6 Reputation points
2022-03-31T05:15:11.463+00:00 you don't need to install LTSC, try with versions below 17.1.0 - I think 17.0.6 would work. Yes, deleting obj and bin helped me (in both Shared and Project), but the problem is that you need to delete them a couple of times because VS creates it just after you delete them. Since I have no time to waste I started with downgrading version until I found the one that works. I hope MAUI will have less bugs...
-
Nathan Sokalski 4,116 Reputation points
2022-03-31T15:58:09.473+00:00 you need to delete them a couple of times
How many times is "a couple of times"? If it recreates them just after you delete them, won't that just put you right back where you started from?
-
Dalibor Markovic 6 Reputation points
2022-04-01T05:34:16.01+00:00 no, it just recreates some of the files, but I suggest you downgrade VS to version that works, below 17.1.0
Sign in to comment -
-
JarvanZhang 23,951 Reputation points
2022-02-28T03:01:18.867+00:00 I have found the Device Log Tool, but I could not find the Debug Log Tool (is that the same thing?). But I also was not sure how to attach the device log.
Hi, njsokalski. Device Log is just the tool to get the log. For how to obtain the log, you could refer to the following doc:
https://learn.microsoft.com/en-us/xamarin/android/deploy-test/debugging/android-debug-log?tabs=windows-
Nathan Sokalski 4,116 Reputation points
2022-02-28T04:31:02.213+00:00 I looked at that, but the post at
says "attach the debug logs". What does that mean? The page you mention tells how to view the log in VS, but I don't know how to attach that. Is there some file? Is there some tool for attaching it?
-
JarvanZhang 23,951 Reputation points
2022-02-28T05:21:22.957+00:00 You could create a text file. Then click Control + A to copy all the logs and paste the log to the created text file.
Sign in to comment -