我剛安裝了Xamarin for VS2015,並創建了一個空白的Android應用程序。不幸的是,Xamarin提供的Android虛擬設備都不會運行我提供的小模板應用程序。 Visual Studio提供了「有部署錯誤」的無用信息。展望日誌揭示了這一點:無法用Xamarin和Visual Studio Community 2015啓動Android虛擬設備
System.InvalidOperationException
at Xamarin.VisualStudio.Android.AndroidVirtualDeviceProvider.StartEmulator(IAndroidVirtualDevice virtualDevice, IProgressReport progress, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio.Android\Devices\AndroidVirtualDeviceProvider.cs:line 148
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.StartUp(IMonoAndroidDevice device, IProgressReport progress, IAndroidVirtualDeviceProvider virtualDeviceProvider, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio.Android\CommandHandlers\StartupVirtualDeviceCommandHandler.cs:line 72
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.Execute(StartupVirtualDeviceCommand command, IProgressReport progress, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio.Android\CommandHandlers\StartupVirtualDeviceCommandHandler.cs:line 45
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.Execute(TCommand command, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 152
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.<>c__DisplayClass1_0.<ExecuteAsync>b__0() in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 118
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Xamarin.VisualStudio.ProgressReport Error: 0 : [2016-07-09 15:31:19.0670] System.InvalidOperationException
at Xamarin.VisualStudio.Commands.CommandHandlerBase.ProcessAggregateInnerException(Exception innerException, IProgressReport progress) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 38
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.Execute(TCommand command, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 145
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.<>c__DisplayClass1_0.<ExecuteAsync>b__0() in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 118
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Xamarin.VisualStudio.ProgressReport Error: 0 : [2016-07-09 15:32:08.4234] System.InvalidOperationException
at Xamarin.VisualStudio.Android.AndroidVirtualDeviceProvider.StartEmulator(IAndroidVirtualDevice virtualDevice, IProgressReport progress, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio.Android\Devices\AndroidVirtualDeviceProvider.cs:line 148
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.StartUp(IMonoAndroidDevice device, IProgressReport progress, IAndroidVirtualDeviceProvider virtualDeviceProvider, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio.Android\CommandHandlers\StartupVirtualDeviceCommandHandler.cs:line 72
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.Execute(StartupVirtualDeviceCommand command, IProgressReport progress, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio.Android\CommandHandlers\StartupVirtualDeviceCommandHandler.cs:line 45
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.Execute(TCommand command, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 132
Xamarin.VisualStudio.ProgressReport Error: 0 : [2016-07-09 15:32:08.4404] System.InvalidOperationException
at Xamarin.VisualStudio.Commands.CommandHandlerBase.ProcessAggregateInnerException(Exception innerException, IProgressReport progress) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 38
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.Execute(TCommand command, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 145
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.<>c__DisplayClass1_0.<ExecuteAsync>b__0() in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 118
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Xamarin.VisualStudio.Android.AndroidDeviceSettings Information: 0 : [2016-07-09 15:32:38.9678] Settings successfully saved.
Xamarin.VisualStudio.Android.AndroidDeviceSettings Information: 0 : [2016-07-09 15:36:56.2277] Settings successfully saved.
Xamarin.VisualStudio.ProgressReport Error: 0 : [2016-07-09 15:37:04.7492] System.InvalidOperationException
at Xamarin.VisualStudio.Android.AndroidVirtualDeviceProvider.StartEmulator(IAndroidVirtualDevice virtualDevice, IProgressReport progress, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio.Android\Devices\AndroidVirtualDeviceProvider.cs:line 148
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.StartUp(IMonoAndroidDevice device, IProgressReport progress, IAndroidVirtualDeviceProvider virtualDeviceProvider, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio.Android\CommandHandlers\StartupVirtualDeviceCommandHandler.cs:line 72
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.Execute(StartupVirtualDeviceCommand command, IProgressReport progress, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio.Android\CommandHandlers\StartupVirtualDeviceCommandHandler.cs:line 45
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.Execute(TCommand command, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 152
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.<>c__DisplayClass1_0.<ExecuteAsync>b__0() in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 118
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Xamarin.VisualStudio.ProgressReport Error: 0 : [2016-07-09 15:37:04.7662] System.InvalidOperationException
at Xamarin.VisualStudio.Commands.CommandHandlerBase.ProcessAggregateInnerException(Exception innerException, IProgressReport progress) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 38
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.Execute(TCommand command, CancellationToken cancellationToken) in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 145
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.<>c__DisplayClass1_0.<ExecuteAsync>b__0() in C:\Users\builder\data\lanes\3420\ee3cfcdd\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 118
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Xamarin.VisualStudio.Android.AndroidDeviceSettings Information: 0 : [2016-07-09 15:41:33.7269] Settings successfully saved.
谷歌搜索的錯誤帶來了this other question,這是通過啓用硬件虛擬化解決了,但我不太清楚這意味着什麼。我試圖解決自己的問題,但我不知道發生了什麼。更糟糕的是,我的電腦上似乎有兩個獨立的Android SDK副本,一個在之一,另一個在%USER_HOME%/AppData/Local/Xamarin/MonoForAndroid/AndroidSDK
之間。 Android
中有一個SDK Manager和AVD Manager,但Xamarin沒有。據我所知,似乎沒有使用Android
中的那個,但它是由Xamarin安裝的。
儘管你找到了解決問題的方法,正如ThamiDev在答案中所說的那樣,你真的應該看看Genymotion,它確實是一款很好的軟件,可以快速啓動,並且可以使用很多不同的設備! – YumeYume
儘管Genymotion速度更快,但它鎖定了付費牆後的一些功能,最顯着的是聯網功能,而且我無法證明花費是合理的。 – MadDoctor5813