Visual Studio 2013中Xamarin应用程序部署失败

7

我尝试运行我的Xamarin应用程序,它成功构建了,但在尝试调试时,出现了以下异常。

据我所知,由于以下消息显示在部署状态消息下面:

意外安装输出:错误:无法访问包管理器。系统是否在运行?

可能是由于缺少某些包。

调试输出

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 ==========

你能解决这个问题吗? - sham
@sham 我也是这样.. 你们中有人能解决吗?? - fabricio
@fabricio 我无法解决这个问题。 - sham
2
@sham 我想我所做的是从我的手机上卸载该应用程序... 你需要进入“全部”或“运行中”选项卡,然后卸载“com.yourapplication”包(有一个 adb 命令可用于卸载 apk,我没有使用,但它可能对你有用) - fabricio
下载Java JDK v1.7.0安装程序到磁盘上的任意目录,双击下载的文件并按照屏幕上的说明进行操作。即使使用64位Windows,安装32位版本的Java JDK非常重要。同时安装Java JDK v1.6也很重要(尽管同时安装Java JDK 1.7或更新版本是可以的)。 将Android NDK for Windows版本r10e下载到磁盘上的任意目录,然后双击它启动NDK安装。 - sham
1个回答

1

你是否正在使用基于ARM的模拟器(我也遇到了同样的问题)?

如果是,则这些模拟器非常慢,应用程序无法部署,直到启动这些模拟器。

请使用基于x86的模拟器,虽然速度没有那么快,但至少可以忍受。

无论如何(x86或ARM),先启动模拟器,等待看到主屏幕。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接