4

I'm testing Xamarin apps using Android emulators on Windows 10, and whenever I close (shut down) an emulated Android device, its data partition size in Android Device Manager (disk.dataPartition.Size) is reset to a value of 6442450944, so roughly 6.4GB(*). Whenever I want to restart an emulator, I have to edit its partition to something like 800M, because leaving the value at 6442450944 and attempting to deploy my apps gives the following errors:

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.<InstallPackage>b__0(Task`1 t) in E:\A\_work\35\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()


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.<InstallPackage>b__0(Task`1 t) in E:\A\_work\35\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

I think resetting the partition forces the emulator to do a factory reset, which then allows the app to be deployed successfully. I have tested this with brand-new Xamarin projects as well and the same error occurs. I have reinstalled and updated my Android SDK and tools several times. Does anyone know why this is happening? How can I stop it?

(*): I think it's worth noting that this is the only property that gets changed by closing the emulator. Everything else in the default property menu remains the same as I set it.

Nick
  • 155
  • 1
  • 10

2 Answers2

0

It is an old known issues.

But there is a workaround you can try which is to edit the config.ini file and use 'm' instead.

File Config.ini can be found in C:\Users{username}.android\avd{emulator_name}

For more details, you can check:

https://forums.xamarin.com/discussion/123316/xamarin-android-device-manager-disk-datapartition-size-bug

Jessie Zhang -MSFT
  • 9,830
  • 1
  • 7
  • 19
  • Seems to differ between android versions. With target=android-30, it always resets `disk.dataPartition.size` to 6442450944, no matter if 2g or 2G or without g but in bytes. Using target=android-25, it accepts `disk.dataPartition.size=2G` (even uppercase) – allofmex Nov 09 '20 at 12:42
0

This is a sad, pathetic answer but after making multiple emulators available to me, the Pixel 3XL emulator worked.

Despite the partition size still being 6442450944, its only taking 1GB.

I can reopen after resetting. I hope this issue is resolved properly eventually.

enter image description here enter image description here

Jayowl
  • 280
  • 3
  • 11