Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin failed to deploy app to emulator with: "Unexpected install output: cmd: Can't find service: package"

I'm building the sample intro xamarin forms app With Visual studio 2019 and the emulator boots up but the app doesn't deploy with the error Unexpected install output: cmd: Can't find service: package":

1>No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily. 1>C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.9\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:\Users\sticker592\AppData\Local\Xamarin\Mono for Android\debug.keystore"  1>C:\Program Files (x86)\Android\android-sdk\build-tools\25.0.3\zipalign.exe -p 4 "C:\Users\sticker592\Downloads\FirstApp\AwesomeApp\AwesomeApp.Android\obj\Debug\81\android\bin\com.companyname.AwesomeApp.apk" "bin\Debug\\com.companyname.AwesomeApp-Signed.apk"  1>C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.9\bin\java.exe -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\25.0.3\lib\apksigner.jar" sign --ks "C:\Users\sticker592\AppData\Local\Xamarin\Mono for Android\debug.keystore" --ks-pass pass:android --ks-key-alias androiddebugkey --key-pass pass:android --min-sdk-version 21 --max-sdk-version 27  C:\Users\sticker592\Downloads\FirstApp\AwesomeApp\AwesomeApp.Android\bin\Debug\com.companyname.AwesomeApp-Signed.apk  1>ADB0000:  Deployment failed 1>Mono.AndroidTools.InstallFailedException: Unexpected install output: cmd: Can't find service: package 1> 1>   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A\_work\413\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 345 1>   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.<InstallPackage>b__0(Task`1 t) in E:\A\_work\413\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753 1>   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() 1>   at System.Threading.Tasks.Task.Execute() 1>ADB0010: Unexpected install output: cmd: Can't find service: package 1> 1>   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A\_work\413\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 345 1>   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.<InstallPackage>b__0(Task`1 t) in E:\A\_work\413\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753 1>   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() 1>   at System.Threading.Tasks.Task.Execute() 1>Done building project "AwesomeApp.Android.csproj" -- FAILED. 1>Build FAILED. 
like image 742
user5389726598465 Avatar asked Feb 01 '19 15:02

user5389726598465


1 Answers

In my case it helped to do a Factory Reset of the emulation device in the Android Device Manager.enter image description here

like image 189
this.myself Avatar answered Oct 04 '22 23:10

this.myself