我尝试了更多来运行我的Xamarin应用程序。它成功构建,但在尝试调试时,以下ecxceptions上升。
据我所知,有些错过了包裹,因为
意外的安装输出:错误:无法访问程序包管理器。系统正在运行吗?
消息显示在部署状态消息下方。
调试输出
1>_PrimaryCpuAbi=armeabi-v7a
1>Detecting installed packages...
1>Target device is armeabi-v7a.
1>Installing the Mono shared runtime (debug - 1466176850)...
1>10% ... 3776kb of 37460kb copied
1>20% ... 7552kb of 37460kb copied
1>30% ... 11264kb of 37460kb copied
1>40% ... 15040kb of 37460kb copied
1>50% ... 18752kb of 37460kb copied
1>60% ... 22528kb of 37460kb copied
1>70% ... 26240kb of 37460kb copied
1>80% ... 30016kb of 37460kb copied
1>90% ... 33728kb of 37460kb copied
1>100% ... 37460kb of 37460kb copied
1>:Deployment failed
1>Mono.AndroidTools.InstallFailedException: Unexpected install output: Error: Could not access the Package Manager. Is the system running?
1>
1> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
1> at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass90_0.<InstallPackage>b__0(Task`1 t)
1> at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
1> at System.Threading.Tasks.Task.Execute()
1>The "InstallPackageAssemblies" task failed unexpectedly.
1>System.AggregateException: One or more errors occurred. ---> Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.InstallFailedException: Unexpected install output: Error: Could not access the Package Manager. Is the system running?
1>
1> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
1> at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass90_0.<InstallPackage>b__0(Task`1 t)
1> at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
1> at System.Threading.Tasks.Task.Execute()
1> --- End of inner exception stack trace ---
1> at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>d__99.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
1> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1> at Xamarin.AndroidTools.AndroidDeploySession.<StartAsync>d__98.MoveNext()
1> --- End of inner exception stack trace ---
1> at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
1> at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
1> at System.Threading.Tasks.Task.Wait()
1> at Xamarin.Android.Tasks.InstallPackageAssemblies.Execute()
1> at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1> at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
1>---> (Inner Exception #0) Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.InstallFailedException: Unexpected install output: Error: Could not access the Package Manager. Is the system running?
1>
1> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
1> at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass90_0.<InstallPackage>b__0(Task`1 t)
1> at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
1> at System.Threading.Tasks.Task.Execute()
1> --- End of inner exception stack trace ---
1> at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>d__99.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
1> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1> at Xamarin.AndroidTools.AndroidDeploySession.<StartAsync>d__98.MoveNext()<---
1>`enter code here`
1>Done building project "App1.csproj" -- FAILED.
1>Build FAILED.
1>
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
答案 0 :(得分:1)
您是否正在使用基于ARM的仿真器(我遇到了同样的问题)?
如果是,那么它们将非常缓慢,并且只有在启动这些应用程序之后才能部署该应用程序。
使用基于x86的仿真器,这些仿真器的速度并不快,但至少可以忍受。
在任何情况下(x86或ARM),请先启动仿真器,然后等待直到看到主屏幕为止。