简体   繁体   English

在Xamarin更新后,Xamarin.Android调试构建在VisualStudio 2015中失败

[英]Xamarin.Android debug builds failing in VisualStudio 2015 after Xamarin update

Using VisualStudio 2015 update 2 for a Xamarin app solution with Xamarin.Forms (PCL), Xamarin.Android, and Xamarin.iOS projects. 使用Visual Studio 2015 update 2获取Xamarin应用程序解决方案,包括Xamarin.Forms(PCL),Xamarin.Android和Xamarin.iOS项目。

After upgrading Xamarin.Forms from 2.1.0.6529 to 2.2.0.31 today, debug builds of the Xamarin.Android app within VisualStudio started consistently failing with the following message: 在今天将Xamarin.Forms从2.1.0.6529升级到2.2.0.31后,VisualStudio中的Xamarin.Android应用程序的调试版本始终失败,并显示以下消息:

Xamarin.Android.Common.targets(1853,3): error XA5213: java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing 'java.exe -jar 

I am certainly open to the suggestion to increase $(JavaMaximumHeapSize) , and it looks like an MSBuild property by the $() syntax, but I'm not certain where I would set this. 我当然$(JavaMaximumHeapSize)接受增加$(JavaMaximumHeapSize)的建议,它看起来像$()语法的MSBuild属性,但我不确定在哪里设置它。

How or where is the JavaMaximumHeapSize specified for Xamarin.Android builds in Visual Studio? 在Visual Studio中为JavaMaximumHeapSize指定的JavaMaximumHeapSize是如何或在何处构建的?

Found this thread on Xamarin Forums that indicates the JavaMaximumHeapSize property can be added to the Xamarin.Android project's csproj file. 在Xamarin论坛上找到了这个线程 ,表明JavaMaximumHeapSize属性可以添加到Xamarin.Android项目的csproj文件中。

Looked at the csproj file with text editor, and found the JavaMaximumHeapSize element already existed in the first PropertyGroup , but there was no value in the element. 使用文本编辑器查看csproj文件,发现第一个PropertyGroup已存在JavaMaximumHeapSize元素,但元素中没有值。

So I put 1G in as a value, and the Xamarin.Android project began building successfully once again: 所以我把1G作为一个值,Xamarin.Android项目再次开始成功构建:

<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>

Hope this saves someone else a bit of searching. 希望这可以节省其他人一些搜索。

Yep it worked for me also. 是的,它对我也有用。 One of my projects already had the stub while the other didn't at all. 我的一个项目已经有了存根,而另一个项目根本没有。

I tried putting the limit up to 10G but that seems to struggle and wouldn't build so I changed it back to the 1G as shown. 我尝试将限制设置为10G,但这似乎很难并且不会构建,所以我将其更改为1G,如图所示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM