Forum Xamarin.Android

Android Emulator deployment broken in VS 2019

Hi everyone,
Deploying my Xamarin.Forms app onto emulated Android devices has suddenly become impossible. (Running Visual Studio 2019)

The devices stored in Android Device Manager no longer show up in the Debug menu - my only option for deployment is "Android Emulator", which just opens the Android Device Manager and tries to create a new device. Creating a new device does not deploy the app to it.

Additionally, any emulated device, no matter what value I set for disk.dataPartition.size (have tried changing in both ADM and in the config.ini file), it always resets to 6442450944 after the device boots. The device eventually crashes, giving an error message "Google Play services are not responding" and becoming unresponsive entirely.

I have updated my Android SDK and all NuGet packages for my PCL, .Android and .iOS projects just today. Everything was working fine yesterday, and now I can't test my app. I've tried to deploy to my Google Pixel 3 (with debug mode turned on) via USB cable, but now Visual Studio won't even detect that.

Tools > Android > Restart Adb Server is greyed out, and Device Log does nothing.

Any help is appreciated. I don't have access to a Mac to test the iOS version in the meantime so this is very important to me. Thanks again.

Answers

  • nmrl64nmrl64 Member ✭✭
    edited August 2019

    Update: Running a new blank Xamarin.Forms app deploys correctly to all devices.

    Devices now showing up in Debug menu for my app again after restarting computer. Deployment to physical Android device working, but emulators still crashing and DataPartition size keeps being reset to huge number.

    Visual Studio gives following dialog box: "There were deployment errors. Continue?" which doesn't seem to have an effect whether I click Yes or No.

    Output from failed deployment:

    `ADB0000: Deployment failed
    Mono.AndroidTools.InstallFailedException: Unexpected install output: cmd: Can't find service: package

    at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A_work\35\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 345
    at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.b__0(Task1 t) in E:\A\_work\35\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753 at System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke()
    at System.Threading.Tasks.Task.Execute()
    ADB0010: Unexpected install output: cmd: Can't find service: package

    at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A_work\35\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 345
    at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.b__0(Task1 t) in E:\A\_work\35\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753 at System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke()
    at System.Threading.Tasks.Task.Execute()
    Done building project "ProjectName.Android.csproj" -- FAILED.
    Build FAILED.
    2>Deployment failed to tablet_7_inch.
    ========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
    ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========`

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited August 2019
  • nmrl64nmrl64 Member ✭✭

    Issue is somewhat resolved. Can still deploy to physical device, and reinstalling Android SDK, API 28, and Android 9.0 seemed to work okay for deployment on emulators. But, upon reopening the solution this morning, deployment to emulators is no longer possible for seemingly no reason - still get same errors. No changes to code have been made. I don't want to have to reinstall everything Android/recreate a new emulator every time I boot up my PC?

  • JarvanJarvan Member, Xamarin Team Xamurai

    Did the problem only occur on the Android 9.0 emulator? Are you trying to deploy code on other sdk like Android 8.0?

  • nmrl64nmrl64 Member ✭✭
    Yes, I tried to deploy to an 8.0, both before and after installing 9.0, and neither time did it work. And the physical Android phone I'm deploying to is running 9.0
  • msdYqbmsdYqb USMember ✭✭

    try create new device with armeabi-v7a processor
    I fix mine yesterday simply buy changing the processor because its turn out for my case my cpu cannot run x86 processors

  • luismatoslunaluismatosluna USMember ✭✭

    I had the same issue. In my case, I have disabled the UITest and UnitTest projects from the configuration build, and everything started working again.

Sign In or Register to comment.