Xamarin不会部署

时间:2016-10-12 02:25:48

标签: xamarin visual-studio-2015 xamarin.android xamarin.forms

大家晚安!

我正在尝试开始使用Xamarin进行开发,但是我很幸运能把事情放在第一位。 我最近安装了VS2015的自定义选项,我检查了安装Xamarin。设置完成后,我将Xamarin和android SDK更新到最新版本。当我尝试部署一个简单的应用程序(刚创建一个新项目并尝试启动)时,部署失败。 我尝试了很多解决方案,例如:重新安装所有内容,更新android sdk,下载xamarin android播放器,创建新设备,将java sdk更新到1.8.0版等等。一切都没有成功。有人能给我一个灯吗?我在这里没有选择。在错误的堆栈跟踪下面:

1>The "InstallPackageAssemblies" task failed unexpectedly.
1>System.AggregateException: One or more errors occurred. ---> Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.AdbException: Read-only file system
1>   at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token)
1>   at Mono.AndroidTools.Adb.AdbSyncClient.EndPush(IAsyncResult result)
1>   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
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__26.MoveNext()
1>---> (Inner Exception #0) Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.AdbException: Read-only file system
1>   at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token)
1>   at Mono.AndroidTools.Adb.AdbSyncClient.EndPush(IAsyncResult result)
1>   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
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>
1>Build FAILED.
1>
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

这里是Xamarin和android虚拟设备的当前配置: Xamarin config Android virtual device

--------- --------- EDIT

我设法通过xamarin android播放器和Visual Studio Emulator for android运行android虚拟机。但我仍然无法部署应用程序。现在我收到了错误:

Android application is debugging.
10-12 02:20:32.251 D/dalvikvm( 1429): Late-enabling CheckJNI
10-12 02:20:32.279 D/dalvikvm( 1429): Trying to load lib /data/app-lib/App2.App2-1/libmonodroid.so 0xa8fb7c58
10-12 02:20:32.279 D/dalvikvm( 1429): Added shared lib /data/app-lib/App2.App2-1/libmonodroid.so 0xa8fb7c58
10-12 02:20:32.279 W/monodroid( 1429): Using override path: /data/data/App2.App2/files/.override
10-12 02:20:32.279 W/monodroid( 1429): Trying to load sgen from: /data/data/App2.App2/files/.override/libmonosgen-2.0.so
10-12 02:20:32.279 W/monodroid( 1429): Trying to load sgen from: /storage/emulated/0/Android/data/App2.App2/files/.override/libmonosgen-2.0.so
10-12 02:20:32.279 W/monodroid( 1429): Trying to load sgen from: /data/app-lib/App2.App2-1/libmonosgen-2.0.so
10-12 02:20:32.279 W/monodroid( 1429): Trying to load sgen from: /data/data/App2.App2/files/.override/links/libmonosgen-2.0.so
10-12 02:20:32.283 W/monodroid-debug( 1429): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8933,server=y,embedding=1
10-12 02:20:32.467 W/monodroid-debug( 1429): Accepted stdout connection: 43
10-12 02:20:33.239 D/Mono ( 1429): Image addref mscorlib[0xb7dd76f0] -> mscorlib.dll[0xb7de49e0]: 1
10-12 02:20:33.239 D/Mono ( 1429): AOT module 'mscorlib.dll.so' not found: dlopen failed: library "/data/app-lib/App2.App2-1/libaot-mscorlib.dll.so" not found
10-12 02:20:33.239 D/Mono ( 1429): AOT module '/Users/builder/data/lanes/3819/96c7ba6c/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/mscorlib.dll.so' not found: dlopen failed: library "/data/app-lib/App2.App2-1/libaot-mscorlib.dll.so" not found
10-12 02:20:33.239 D/Mono ( 1429): Config attempting to parse: 'mscorlib.dll.config'.
10-12 02:20:33.239 D/Mono ( 1429): Config attempting to parse: '/Users/builder/data/lanes/3819/96c7ba6c/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/mscorlib/mscorlib.config'.
Could not connect to the debugger.

到目前为止我尝试了什么:
   - 禁用快速部署    - 向清单添加以下权限:ACCESS_COARSE_LOCATION,INTERNET。
   - 检查支持的架构:armeabi,armeabi-v7a    - 在hyper-v兼容性选项卡中选中“迁移到具有不同处理器版本的物理计算机”选项。

以上都没有为我工作,到目前为止我找不到任何其他解决方案。

提前致谢!最好的问候。

2 个答案:

答案 0 :(得分:3)

上面的建议“简单只是取消选中快速部署。”也适用于带有 android 模拟器 (https://github.com/google/android-emulator-m1-preview) 的新 MacBook M1 Apple arm 处理器 Visual Studio Xamarin。

enter image description here

答案 1 :(得分:1)

简单,只需取消选中快速部署即可。

enter image description here