Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
652 views
in Technique[技术] by (71.8m points)

android - 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 FilesAndroidjdkmicrosoft_dist_openjdk_1.8.0.9inkeytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:Userssticker592AppDataLocalXamarinMono for Androiddebug.keystore" 
1>C:Program Files (x86)Androidandroid-sdkuild-tools25.0.3zipalign.exe -p 4 "C:Userssticker592DownloadsFirstAppAwesomeAppAwesomeApp.AndroidobjDebug81androidincom.companyname.AwesomeApp.apk" "binDebug\com.companyname.AwesomeApp-Signed.apk" 
1>C:Program FilesAndroidjdkmicrosoft_dist_openjdk_1.8.0.9injava.exe -jar "C:Program Files (x86)Androidandroid-sdkuild-tools25.0.3libapksigner.jar" sign --ks "C:Userssticker592AppDataLocalXamarinMono for Androiddebug.keystore" --ks-pass pass:android --ks-key-alias androiddebugkey --key-pass pass:android --min-sdk-version 21 --max-sdk-version 27  C:Userssticker592DownloadsFirstAppAwesomeAppAwesomeApp.AndroidinDebugcom.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\_work413sExternalandroidtoolsMono.AndroidToolsInternalAdbOutputParsing.cs:line 345
1>   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.<InstallPackage>b__0(Task`1 t) in E:A\_work413sExternalandroidtoolsMono.AndroidToolsAndroidDevice.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\_work413sExternalandroidtoolsMono.AndroidToolsInternalAdbOutputParsing.cs:line 345
1>   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.<InstallPackage>b__0(Task`1 t) in E:A\_work413sExternalandroidtoolsMono.AndroidToolsAndroidDevice.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.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...