Xamarin.forms: [Bug] The "XamlGTask" task could not be initialized with its input parameters.

Created on 9 Jun 2019  路  8Comments  路  Source: xamarin/Xamarin.Forms

Description

This appears to be the same issue as #2975

The "References" parameter is not supported by the "XamlGTask" task.
The "XamlGTask" task could not be initialized with its input parameters.

I believe it has to do with the mis-matching version of Xamarin.Forms used by projects. I am using Xamarin.Forms 4.0 and I depend on SkiaSharp.Views.Forms, which depends on 3.3.

This works on Windows, see the PR in the links.

Steps to Reproduce

  1. Create a new forms project that uses forms 4
  2. Create a library project that uses skiasharp.views.forms 1.68.0
  3. Add a reference from the sample netstandard to the new library
  4. Observe error
  5. Install forms into the library
  6. Observe success

Observe issue.

Expected Behavior

The project should compile, regardless of the dependency of SkiaSharp.

Actual Behavior

Somehow something is getting mixed up and cont compiling.

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:

    • iOS:

    • Android:

    • UWP:

  • Android Support Library Version:
  • NuGet Packages:
  • Affected Devices:

Screenshots

Reproduction Link

Example project: Archive.zip

buildchain 5 bug

Most helpful comment

This bug is driving my insane. It has been there for years and years now. Every time you open a project you have not been using for some time, you have to close and clean and close and remove obj and bin folders manually, and if you are lucky it will suddenly work (for awhile).

All 8 comments

this indicates you have references to multiple forms versions in your solution. We should fail more gracefully, but I have to check if that code was already present in 3.3

Finally got around this error. Visual Studio for Mac does not exclude/unload projects that were excluded/unloaded in Visual Studio 2017 on Windows. This causing an old Test project to load which referenced an older version of Xamarin Forms.

Please make this error more helpful!

This bug is driving my insane. It has been there for years and years now. Every time you open a project you have not been using for some time, you have to close and clean and close and remove obj and bin folders manually, and if you are lucky it will suddenly work (for awhile).

Today I think I used 80% of my time getting the build system to work and 20% actually coding. I do think, I need to change to JetBrains Rider and see if that is better. Else changing away from Xamarin.Forms is something I have to consider.

This is beginning to be ridiculous...

To be a little more constructive. It has something to do with iOS and Droid in the same project. If I unload the Droid project, I always get this error. If Droid is loaded and I clear "bin" and "obj" folders, I have to click on "Rebuild All" in the menu. If I click on the "Run" og just try to build the iOS project I get this error. So Rebuilding all first and then Run. That is where I get the best result and not getting this error. (But not always)

I also have this problem very regularly for production apps. My workaround has been to nuke the whole cached package folder (where ".targets" resides) and either reinstall the Xamarin.Forms package from scratch or sometimes the build will rebuild the lib and build folders where the problem occurs

The problem also occurs with us! Is very critical for us, because we build a version (hotfix) for our Productive Live App every 2 days. Something must definitely happen here, we can't reinstall Forms every week. With us this occurs with the current 4.5 - version. @samhouts Can you push the problem again or add it to the build pipeline?
2020-03-31 14_19_30-Appzeug _ Microsoft Teams

@Coruscate5 @MickLesk What version(s) of Visual Studio do you use? Thanks!

Was this page helpful?
0 / 5 - 0 ratings