"AdjustJavacVersionArguments"任务意外失败
作为一个初学者,我已经开始在Visual Studio Enterprise 2015
中开发Xamarin.Forms
应用程序.构建解决方案时,我会收到如下错误:
I have started developing Xamarin.Forms
applications in Visual Studio Enterprise 2015
as a beginner. When I build my solution I am getting an error like this:
"AdjustJavacVersionArguments"任务意外失败.
The "AdjustJavacVersionArguments" task failed unexpectedly.
严重性代码描述项目文件行抑制状态 错误"AdjustJavacVersionArguments"任务意外失败. System.NullReferenceException:对象引用未设置为对象的实例. 在Xamarin.Android.Tasks.AdjustJavacVersionArguments.Execute() 在Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 在Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()XamarinDemo.Android
Severity Code Description Project File Line Suppression State Error The "AdjustJavacVersionArguments" task failed unexpectedly. System.NullReferenceException: Object reference not set to an instance of an object. at Xamarin.Android.Tasks.AdjustJavacVersionArguments.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() XamarinDemo.Android
此错误的确切含义是什么?我的JDK版本是否有问题?
What exactly this error means? Do I have a problem with my JDK version?
问题已解决.我卸载了JDK v9,而是安装了JDK v8.后来,在Visual Studio中,我选择了工具"->选项",然后向下滚动并找到了"Xamarin"->"Android设置",并用JDK v8所在的路径更改了Java Development Kit Location
.构建解决方案后,错误消失了.
Problem was solved. I uninstalled JDK v9 and instead installed JDK v8. Later on, in Visual Studio I selected "Tools" -> "Options" and just scrolled down a little and found "Xamarin" -> "Android Settings" and changed the Java Development Kit Location
with the path where the JDK v8 is located. After building the solution, error has been gone.