none
[VS2019][Xamarin]App deployment fails due to android emulator RRS feed

  • Question

  • Hi All,

    I've posted this problem on the Xamarin forum (link: https://forums.xamarin.com/discussion/comment/377678#Comment_377678) and what I thought was the proper VS development forum (link: https://social.msdn.microsoft.com/Forums/vstudio/en-US/5cba84c1-058d-4195-a6ef-558e8f7712ea/vs2019xamarinapp-deployment-fails-due-to-android-emulator?forum=visualstudiogeneral) but I was redirected to this one so maybe you can help. At this point I will repeat what I told the other forums; that I'm completely new to Xamarin Forms, and Android for that matter, so please forgive my ignorance of them.

    Having installed VS2019, and wanting to 'try out' Xamarin Forms I created a test app as specified in MS Xamarin docs "Build your first Xaramin.Forms App" (link: https://docs.microsoft.com/en-us/xamarin/get-started/first-app/?pivots=windows) and having followed all of the instructions I attempted to run/debug the app. The first emulator I tried was the "VisualStudio_android-23_arm_phone(Android 6.0 - API 23)". I then tried the "VisualStudio_android-23_x86_phone(Android 6.0 - API 23)". The app failed to deploy to both of these emulators with exactly the same error as follows:

    ADB0060: There is not enough storage space on the device to store package: /data/local/tmp/Mono.Android.DebugRuntime-debug.apk. Free up some space and try again.
       at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
       at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.<InstallPackage>b__0(Task`1 t)
       at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
       at System.Threading.Tasks.Task.Execute()

    I subsequently tried increasing the storage space through the emulator settings. This seemed to fix the "not enough storage space on the device" error but the emulator just 'hung' while VS was waiting for runtime checks to complete. I can't say that the emulator 'hung' forever but I gave up after waiting for something to happen after an hour. I have reported this problem via the VS "Report a Problem" facility (Link: https://developercommunity.visualstudio.com/content/problem/594635/vs2019android-emulatorapp-always-fails-to-deploy-t.html) but so far it's status has only gone to 'Triaged'.

    As it stands I can't do any Xamarin Forms development as I can't practically test any app I develop. Can anyone help me with this, please?

    Kind regards,


    RobDev

    Thursday, June 13, 2019 1:59 PM

All replies

  • Hi RobDev,

    Welcome to MSDN forum.

    According to your description, the emulator would hung on long time when you increase the storage space. As far as I know, when the emulator runs, it will take up more than storage space you set. And the storage space is mainly from your memory of the machine.

    So we recommend to use recommended hardware requirement, or you could set Up external Device for Development.

    Any feedback will be expected.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, June 14, 2019 9:37 AM
  • Hi Dylan,

    many thanks for your reply. There's been some very strange things happening with VS and the Xamarin app I've been trying to test. First of all, though, let me just say that I've checked my system against your 'hardware requirement' link and my system has far exceeds the 'requirements'.

    Yesterday, I thought I'd try building and running the test app with VS2017 and it got a lot further. The app was successfully deployed to the emulator but for some reason the app itself threw an exception when initializing. Now, the only thing that had happened on my computer between then and the time before, when the emulator just hung, was that I installed the Windows update KB4503327. From its description it didn't look to me like it would have made any difference but I'm not an expert.

    Anyway, today I thought I'd try VS2019 again, just to see what would happen, and the emulator and app worked perfectly. I've kept a copy of the build log but there's a lot of it.

    I then thought I'd try running with VS2017 again but this time it failed saying that there were errors during deployment.

    I've just tried running it from VS2019 again and, again, everything is working perfectly.

    What is going on here? It seems to me that the Android Emulator is highly unstable, either that or the Visual Studio environment is highly unstable. Do you have any ideas?

    Kind regards,


    RobDev

    Friday, June 14, 2019 2:41 PM
  • Hi RobDev,

    Sorry for delay in reply.

    According to your description, it seems that the Android emulator automatically make use of hardware acceleration for your android application. The hardware acceleration is mainly used in visual studio 2019 environment. And I find a MSDN DOC about this, hope it can help you.

    BTW, this issue is more related to Xamarin, we suggest you could open a new thread to Xamarin forum for detected support.

    Thank you for understanding.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Thursday, June 20, 2019 6:36 AM
  • Hi Dylan,

    many thanks for your reply. I've found out some more interesting information since I last replied. As I mentioned earlier I've reported the problem via the VS "Report a Problem" link (Link:https://developercommunity.visualstudio.com/content/problem/594635/vs2019android-emulatorapp-always-fails-to-deploy-t.html) which I've updated with my latest findings.

    Essentially, what I've found out is this. When I switch between VS2017 and VS2019 to debug the app, the emulator displays the "Cold Boot: Different AVD configuration" message but the app deploys and runs successfully. However, if I try to debug the app a second time on the same VS version the "Cold Boot: Different AVD configuration" message is not displayed and the emulator hangs. This is, presumably, because it's not doing a 'cold boot'. So, it would seem that after a 'cold boot' and running the app successfully the emulator is left in a state which prevents a new instance of the app from being successfully deployed and run. Now, I could be completely wrong, but that seems to me to be the problem. What do you think?

    Also, I have posted this problem on the Xamarin Forum but nobody has replied as yet.

    King regards,


    RobDev

    Thursday, June 20, 2019 3:43 PM
  • Hi Rob Dev,

    Sorry for delay in reply.

    Based on your description, it seems that something which is in Android emulate device is different between different versions of visual studio, maybe it need to be compatible with different version. You could re-create the device when you switch the other version or re-deploy it like what you do before.

    And it is like that it is beyond our support, and the above just my personal view after my research. Hope it can help you.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, June 24, 2019 8:34 AM
  • Hi Dylan,

    many thanks for your reply. I think the important thing is that the Android emulator will run my test app successfully only when in has done a 'Cold Boot'. It doesn't mind whether the app was run from VS2017 or VS2019, they will both successfully run the app provided the emulator does a 'Cold Boot' first. The only way, at the moment I can get the emulator to do a 'Cold Boot' is to switch between VS2017 and VS2019.

    If this is the true situation, and I may be wrong in my conclusions, then it makes emulator virtually unusable.

    Do you know if there is any emulator option I can set to force it to do a 'Cold Boot' each time it's run?

    Failing that, do you (or anyone else) have any ideas as to how to fix this problem?

    Kind regards,


    RobDev

    Monday, June 24, 2019 3:37 PM
  • Hi RobDev, 

    Thank you for reply.

    After research, I sorry that I did not find related options to set Boot method in visual studio and emulator settings.

    From this MS DOC:  Android Emulator Quick Boot, the AVD must perform code boot on its first time, it is for quick boot feature. It is a default feature in emulator. 

    Hope it can help you.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, June 25, 2019 9:58 AM
  • Hi Dylan,

    many thanks for your reply. I read the link you sent me but I'm afraid it doesn't help. The Android emulator that got installed with VS2019 was version 28.0.25-5395263. However, when I run the emulator standalone via the Android Device Manager it claims that there is a later version. The latest version is 29.1.2-5678040 (Canary update channel). Now I don't pretend to know what "Canary update channel" is but if there's a newer version of the emulator available I thought it might fix my problem. However, there doesn't appear to be any way of updating the Android emulator in VS2019 via the Android SDK Manager. I've tried uninstalling and reinstalling the emulator but all I get is the same (old) version.

    I'm afraid I'm at a loss, now, as to what I should do next. The Android emulator, as it is on my machine, is virtually unusable. I'm, therefore, unable to do any Xamarin development as I can't test anything I've developed. This can't be right, surely.

    Is anyone else having this problem?

    Kind regards,


    RobDev

    Tuesday, June 25, 2019 3:27 PM
  • Hi RobDev

    Sorry for delay in reply.

    Please manually uninstall the app via the app manager on the device first before run.

    Sometimes it shows up in the app manager under the namespace only rather than the application name.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, June 27, 2019 7:51 AM
  • Hi Dylan,

    many thanks for your reply and your suggestion of uninstalling the app vis the app manager. This is what I tried:

    1. In order to get the app to deploy and run successfully I, first, tried running from VS2017. Then I ran it from VS2019. This caused it to do a 'Cold Boot' and the app deployed and ran successfully.
    2. I then closed the app on the emulator, went into 'Settings' and was able to uninstall the app.
    3. I then attempted to deploy/run the app again from VS2019 (this time it did not do a 'Cold Boot') but all the happened was the emulator 'hung'. The app was never deployed to the emulator and, obviously, didn't run.
    4. I thought I'd better check running the emulator via the Android Device Manager but, when I did, the emulator just 'hung' again.

    There seems to me to be something very seriously wrong with the emulator. The only way I can get it to behave correctly is to force it to do a 'Cold Boot' and the only way I can do that is to switch between running it from VS2017 and VS2019. Any attempt to run the emulator afterwards without it doing a 'Cold Boot' results  in the emulator hanging. Can you reproduce this problem?

    Kind regards,


    RobDev

    Thursday, June 27, 2019 3:35 PM
  • Hi Dylan,

    your latest reply didn't get posted on the forum, I got it via email. Your reply says the following:

    "Hi RobDev,

    Sorry for this inconvenience.

    In my side, when we open emulator, sometimes we also need to restart it
    twice, and after research, there is not an appropriate interface to set "Cold
    Boot" for emulator in visual studio.

    Best Regards,

    Dylan"

    Thank you for replying, by the way - I don't know what's gone wrong with the forum .

    Anyway, I was wondering, if you have time, could try and create the 'test' app and see if it runs from VS2019? The emulator device I'm running from is VisualStudio_android-23_x86_phone and its settings are shown in the following screen shot:

    Android Emulator Device Settings

    The link for the 'test' app code is https://docs.microsoft.com/en-us/xamarin/get-started/first-app/?pivots=windows 

    I'd be really grateful if you were able to create and run the app as I did to see if you get the same problems as me.

    Kind regards,


    RobDev

    Thursday, July 4, 2019 3:02 PM