Xamarin.Android debug builds failing in VisualStudio 2015 after Xamarin update - xamarin

Using VisualStudio 2015 update 2 for a Xamarin app solution with Xamarin.Forms (PCL), Xamarin.Android, and Xamarin.iOS projects.
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.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.
How or where is the JavaMaximumHeapSize specified for Xamarin.Android builds in Visual Studio?

Found this thread on Xamarin Forums that indicates the JavaMaximumHeapSize property can be added to the Xamarin.Android project's csproj file.
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.
So I put 1G in as a value, and the Xamarin.Android project began building successfully once again:
<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.

Related

New Xamarin.Forms Project Missing References

I have created a brand new Xamarin.Forms project, targeting iOS, in Visual Studio for macOS, and when I try to build I get the following errors, in AppDelegate.cs, about missing assembly references.
I have tried adding references, but I am presented with a blank window.
I also tried updating all NuGet packages, since I found an SO answer which suggested this might resolve the issue, but I'm still having the same problems.
This is my first experience of trying to use Xamarin, and so I really have no idea what I'm supposed to do or what references the project requires to be able to build.
The following are all the dependencies the template project starts out with.
Does anybody know what it is that's missing? How can I get this working? I have XCode 9.3 installed, and Visual Studio is up to date, so that shouldn't be an issue I don't think.
The following image shows the structure of the two projects created when I ran the wizard to generate the new Xamarin.Forms solution.

MSBuild Error VS2015 Xamarin

After an update of VS2015. When I build my cross platform app I get this build error without error No. "Xamarin.Forms require msbuild. xbuild is no longer supported." Anyone have an idea of the cause?
I managed to resolve the issue by updating my xamarin.forms. I noticed the build targets pointed to a missing folder. Updating it adjusted the targets.
I spent 8 hours trying to debug this today. The only solution seems to be updating to VS 2017.

Breakpoints not being hit on Xamarin Android

Yesterday I upgraded to Xamarin.Android 7.3.0, and now none of my breakpoints get hit. I've tried many things to try to get breakpoints to work again, but no luck:
Cleaning the solution
Deleting the bin / obj folders
Closing and reopening Xamarin Studio
Restarting my Mac
Creating a new Android project
Rolling back to Xamarin.Android 7.2, Xamarin.Mac 3.2, and Xamarin Studio 6.2.1.
It doesn't make sense to me that even after creating a brand new project and running it with rolled back Xamarin versions, it still doesn't work. This should eliminate it being the code, and eliminate it being the Xamarin update, and yet it still doesn't work.
The pdb files are generated, so that's something. I have my configuration set to Debug-Dev, this has Debug Information set to Full, and Define Symbols set to:
DEBUG;__ANDROID__
I'm not sure what else to try at this point, help would be appreciated!
This seems to be a bug a bug related to mono 5.0 upgrade. Solution from Bugzilla
Alternate possible temporary workaround for users who have hit this issue after updating (as opposed to a fresh install on a new machine)
(For users who might wish to continue to use Xamarin Studio 6.3 for a little while before transitioning completely to Visual Studio for Mac.)
Set "Project > Active Runtime" to "Mono 4.8.0 (8f6d0f6) (/Library/Frameworks/Mono.framework/Versions/4.8.0)".
Rebuild the Android app project.
Explanation
By default the Mono 5.0 installer will leave the Mono 4.8 tools installed alongside the new Mono 5.0 tools. When the Xamarin.Android build process runs under Mono 4.8, it will generate the old .mdb debugger symbol file format for user assemblies, so the Xamarin Studio debugger will be able to use those symbols. Do note though that the framework debugger symbols files for Xamarin.Android are all shipped as portable .pdb files starting with Xamarin.Android 7.3, so stepping into framework code (as opposed to user code) still would not work as expected.
I had this problem for months, the root folder where I had all my projects had a "#" , I renamed it and now the break points are working just fine.

Xamarin.Forms failed to compile android project with "Droid.Resource.Attribute" does not contain a definition for "actionBarSize"

I have a Xamarin.Forms project, and it worked just fine until I updated my Xamarin Studio Community to latest 5.10.3 (build 51) and updated Xamarin.Forms to 2.2.0.31
When I compile my android project, it showed me
"mynamespace.Droid.Resource.Attribute" does not contain a definition for "actionBarSize"
I did not change anything after upgrade and it works before, I know some others faced the same problem like me when I search on google, seems no one asked this in stackoverflow yet so I would like to get some help here.
If the above doesn't work try this
1) Delete Bin and Obj folders in project folder
2) Delete contents of C:\Users{your username}\AppData\Local\Xamarin\zips
3) Rebuild project
*This will take a while because xamarin will re-download the required files. it should work after its done.
That's a bug listed here. There are different workarounds about this, please try:
Failed to use Android Support Library v4
Creating a Hello World in Visual Studio with Xamarin Forms Fails
Xamarin cross-platform (portable class) project compilation error

Xamarin.Forms UWP missing references

When I create a new project in Xamarin.Forms I get a lot of errors in the UWP part of the project.
It looks like I miss all the referencs in UWP?
I installed Xamarin trough Visual Studios modify
Below is a screenshot of my Visual Studio
I also started to work with Xamarin about two weeks ago and came across many problems and one was just like yours. If you dont have Xamarin studio go and download it. Just do it.
Intellisense breaks really often and you get 200 errors that are dump(or not).
To get rid of the errors there are many ways.
Sometimes you just have to wait.
Open the xaml pages and save them.
Clean - rebuild the project it should run(at third try). If it doesnt you have to open Xamarin studio and built it from there.
If your project is new, just delete it and create a new one.
If you have MVC 5 or Core 1 Installed you will have to remove them(if that doesnt help do a PC Reset like a format).
If it says something for .zip files, find them keep a backup and delete them. Xamarin will re-download on Build.
I had same problem here using Visual Studio 2015 Update 2. Unload the UWP and everything works.
Tried in Xamarin Studio Professional and the following error: -
Could not load project 'blah\blah.UWP\blah.UWP.csproj' with unknown item type '{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A}'
The following link has some helpful points and mentions "UWP is available in Xamarin.Forms 2.1 and later"
https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/
The default setup when creating a new project in VS 2015 Up2 is to use Xamarin Forms v2.0.0.6482, however when I try to update to v2.1.0.6529 I get nuget errors
Checking my output when trying to update to 2.1 using nuget i got the following: -
The content at 'https://{myteamcityserver}/guestAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.UniversalWindowsPlatform'' is not valid XML.
Root element is missing.
So I turned of my local Package Source in Tools | NuGet Package Manager | Package Manager Settings | Package Sources
And woo hoo it all worked for me.
Regards
Peter

Resources