-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploying app is unreliable for both Debug and Release builds #6652
Comments
@dellis1972, @jonathanpeppers. I can't attach the file either way and it is way too big to paste. Will come up with a link later instead. |
@gmck so is this log from the Release build which did not contain the changed file? It would also be useful to see the deployment error your are getting when in Debug mode if you have that log too. Regarding the |
Looking at the log I'm seeing this
Assuming this is a build when a resource file was changed that is a bit odd. It suggests that the file changed was not in the list of inputs for this target or the IDE hadn't saved it. |
Re the release build. Well, I suppose if I'm installing a release build over a debug apk, then adb is correct because we are using different keys. Therefore I conclude that before deploying a release build as an aab, we should manually delete the previous debug apk from the device. I just thought that would have been automatic. I thought I remembered you and @jonathanpeppers discussing that on Discord some time ago and you said that check could probably be removed - actually, it might not have been you maybe someone else discussing with peppers. _Skipping target "CompileResources" because all output files are up-to-date with respect to the input files. Shouldn't the IDE save strings.xml if there has been a change as there was in this case? It certainly worked the next time I deployed - i.e. the altered string was then in the dialog. Re the debug builds, I'll try and remember to save the logs the next time it happens. I just get impatient at that point and restart the IDE and it is ok again the next time I deploy. That bug with the OK button took way too long to solve and the deploying problem wasn't helping with my patience. Will anyone check that example I uploaded to the forum or should I move it over to here? The deployment error is just that - failed to deploy. Why the problem with trying to attach logs? Can't remember that happening with the old issue templates. |
@dellis1972 I then swapped to a different device, deleted the app and tried to Deploy. I'm attaching the log of that one because that gave really weird stuff about - Missing APKs for [SCREEN_DENSITY] dimensions in the module 'base' for the provided device. Never seen that before. Seems to me that the build doesn't recognise that the device has changed, even though VS indicates it has. Cleaned rebuilt deployed and ran ok after that - also had the -k option message as above. |
@dellis1972 Cleaned and rebuilt and deployed all ok, but still with the -k option warning. Anything else you want me to try? |
Looking at the log you provided it seems like you are trying to debug while using That said, looking at the logs it does seem that we did fully build the |
@dellis1972 I don’t understand how you came to that conclusion because I’ve never tried to do that in any app. If you like I can upload the project file contents of my main app for you to check relating to that log. I’ve just done some quick tests with this ColorPalette app. I changed the height of the imageview in main_activity.xml by 1dp. Deployed ok. Changed it back to the original value. Deployed – built ok, failed to deploy. Another example added “To be continued” in the string body_text in strings.xml. Exactly, the same result as above – built ok, failed to deploy.
The only way to recover from the failure is to close the project and then reopen it. Hit deploy and it builds again and then deploys. Yesterday while I was developing this app, I spent most of the day seeing that message just about every time I changed any resource. I’ve even had it happen when just making minor code changes. What can cause it to produce such a minuscule deployment log? – it’s as though it hasn’t even attempted to deploy. Also, check out the unnecessary warnings re 0dp. |
@dellis1972 @jonathanpeppers Hi! |
I have the same Problem with VS17.1.0. |
@mreuterDyconTech @uholeschak do you have diagnostic logs for the issues you are facing see https://docs.microsoft.com/en-us/xamarin/android/troubleshooting/troubleshooting#diagnostic-msbuild-output |
I've been doing some testing and I'm seeing this in the Xamarin logs (Help->Xamarin->Open Logs then open the latest ide log)
I'll ask the Visual Studio team (who maintain the extension) to take a look |
After switching the Xamarin Diagnostics output to Detail it's not happening any more at the moment. |
Is this file helpful? |
After updating to VS17.1.1 the problem still persist. |
Have the same Problem with 17.1.2. |
Yes the problem still persist in 17.1.2. Only closing and reopening the solution before every deployment helps. |
having same problem with VS 2022. I downloaded SyncFusion UI tools. and now i dont know how to deploy to my device. i cant open and close after every change. |
Chiming in to add that issue exists even in Version 17.2.0 Preview 2.1. |
The internal Bug for VS has been marked as Resolved. Looking at the bug properties, they are planning to release this in 17.1 Preview 3. Related PR for VS extension https://github.com/xamarin/XamarinVS/pull/12880 |
how do you close solution? |
404 page not found |
|
I restored my windows to last week..i am still on 17.1.2 and somehow no more errors. |
Its a private repo. That link is there for reference so we can close this issue once the fix has been released. |
VS updated today to 17.1.3, but the problem still persists. |
@dellis1972 |
It looks like the bug was label incorrectly :( I've asked the UI team for an update. |
Same for me. VS updated today to 17.1.3, but the problem still persists. |
Never mind the windows restore trick. Problem came back. |
Please keep us posted. |
I actually noticed that if you try often enough, at some time it starts to work again o.O. |
I have the same issue. Not sure if it was only luck, but it looks like running VS in Admin mode makes it work. Edit: It was just luck. Didn't work the second time. :( |
I just had confirmation that the fix for this issue is shipping is 17.2 Preview 3. |
The WorkItem can be found https://developercommunity.visualstudio.com/t/Deployment-error-on-debug-xamarin-androi/10006948 |
I can't believe such issues still happen and the only workaround since 3 months is to reopen solution. For me every change to Android xml requires reopening solution. Hot reload can have many meanings... |
Had the same problem. What helped me was switching to Visual Studio 2022 LTSC. |
Using good old VS2019 is an option ... |
I am working on a .NET 6.0 project. its not an option for me. "Preview Release" did the trick for me. |
17.2 P5 still has deployment issues. |
With 17.2 Preview 6 I now get errors about random files that are already in use and deploy is canceled... |
@tondat are you able to shed any light on these issues? What data does the IDE team need to investigate? |
ok, the user @dsaf gave me a hint that also works for me. Running VS2022 as admin does the trick for me. Now my errors about files that are in use are gone and deploy also works fine 🤷♂️ |
Anyone with an issue can you do the following please Please run |
Hi @gmck. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you. |
for me the issue still happens in 17.3 P1.1 and this time running VS as admin doesn't fix it |
Android application type
Classic Xamarin.Android (MonoAndroid12.0, etc.)
Affected platform version
VS 2022 17.1.0 Prev 2.0
Description
The last few weeks I’ve only been doing Debug builds and I’ve found that VS 2022 17.1.0 Prev 2 is not very reliable when it comes to deploying to the device. There doesn’t appear to be a pattern, just every now and then you get a message that the Deploy failed. Usually, it is because I tried a one stepper Build/Deploy. The build goes fine and at the end of the build, it starts to deploy and immediately fails. A normal clean/rebuild/deploy all separate steps then fails again on the deploy. The only way I’ve found to fix it is to close VS and start again and then it works fine until the next time it decides to fail which may be some hours later after plenty of good deploys in between.
Today I was ready for a Release build for Google Play. I swapped to Release, Clean, rebuild, deploy and it failed to deploy. Again, I exited VS and the next time it then created the aab and all was good with the upload to Google Play.
I’m attaching that particular build log as it demonstrates something that I thought was fixed sometime back last year.
The warning still has no effect on the deployment, but it would be nice to get rid of it.
Later on, I realised that I’d forgotten to change a resource string in a dialog, so I made the change while it still was in Release. Built and deployed successfully and when I went to check the change, the string was as it was before I made the change. The same thing as before, exited VS and restarted and the next deploy contained the changed string. I don’t think I’ve ever seen that type of failure before when I’ve made a change in strings.xml
Steps to Reproduce
AS above
Did you find any workaround?
As above
Relevant log output
Won't attach.
The text was updated successfully, but these errors were encountered: