Uno: The "CompileXaml" task returned false but did not log an error

Created on 15 Aug 2020  路  9Comments  路  Source: unoplatform/uno

Hi everyone. I'm trying to build my Uno Platform port of my Unofficial Instagram client app "Winsta" but I get the following error and 49 others
The "CompileXaml" task returned false but did not log an error
I don't know exactly why this happens but I think it is related to x:FeildModifier property. Is Feild Modifier implemented to Uno Platform yet?
Otherwise, How can I find why this error happens because even It doesn't mention any file that throws into this issue.

other Nuget Package:
Fody
PropertyChanged.Fody
Uno.Microsoft.toolkit
Uno.Microsoft.Toolkit.UWP.UI.Controls

Package Version(s):
Uno.Core V2.0
Uno.UI V3.0.5
Uno.UI.Lottie V3.0.5

Affected platform(s):

  • [ ] iOS
  • [ ] Android
  • [ ] WebAssembly
  • [ ] WebAssembly renderers for Xamarin.Forms
  • [ ] macOS
  • [ ] Windows
  • [x] Build tasks
  • [ ] Solution Templates

Visual Studio:

  • [ ] 2017 (version: )
  • [x] 2019 (version: 16.7.0)
  • [ ] for Mac (version: )

Relevant plugins:

  • [ ] Resharper (version: )
kinbug triaguntriaged

All 9 comments

Problem solved.

Hey @NGame1, it would be fantastic to post the solution. Else this issue is useless for others who might come across the same problem. What was causing this issue on your side? And what is the solution?

@thomasclaudiushuber are you having a similar issue with latest uno builds ?

@thomasclaudiushuber I was using Uno.Material. it needs UWP project with Target 2004 and MinTarget at least 1903 if I remember correctly.
Uno platform is completely like Xamarin Forms in Errors. Both of them show much garbage errors. You should find the real error between them sometimes it doesn't show the real error.
You can see the Build output to find a probably true error in that log.

Thanks @NGame1 , thanks @jeromelaban ,

I got the same error yesterday on another machine, but as @NGame1 mentioned, beside several other errors. When I saw that this "CompileXaml" task is from the .targets file of the WIndows SDK, I knew it has nothing to do with Uno directly. But I wondered if I might have the same problem as @NGame1.

But as I know now after @NGame1's answer, it's something different in my case. What happened in my case was that somehow the NuGet package restore didn't work for a new Uno solution. I didn't notice in the beginning that it was related to NuGet. I was able to create and run a UWP project in Visual Studio, but running the UWP project of the Uno solution failed, and the WASM project didn't even find the NuGet packages.
In the Package Manager logs I saw that the package source "D:_packages" was not found. Ok, that package source was configured in my Visual Studio installation a while ago, but the local folder didn't exist anymore. I deleted the package source in the Visual Studio options, rebuild everything, and it all worked.

So, everything's fine, it was caused by a NuGet misconfiguration on my side that has nothing to do with Uno.

UPDATE: I was able to reproduce the problem I had, and as mentioned, it is not Uno specific.

  1. Configure a local package source in Visual Studio (in my case "D:/_packages")
  2. Close Visual Studio
  3. Delete the folder of the local package source
  4. Delete the %userprofile%/.nuget folder
  5. Start Visual Studio
  6. Create a new Uno solution
  7. Build it => Different errors pop up, like the CompileXaml error

Now, with that state => Create a new UWP project => Works. But when you try to install a NuGet package there, you get the error "D:_packages" does not exist. In Uno you don't get this error. But the output window of the Package Manager will tell you this problem in a Uno solution.

Thanks for the update. Could you create a msbuild.binlog file by using msbuild /r /bl on the CLI for the project that fails, and post it here ?

Ok, I've created a new Uno solution and configured Visual Studio and NuGet as mentioned in the repro steps above.

The binlog of the UWP project shows clearly what the problem is:
image

Here's the log file (You need to change the extension again to .binlog)
msbuild.bin.log

But when building the UWP project in Visual Studio, it looks like this:
image

When building the solution I get these errors there:
image

Now I remove that wrong package source here:
image

And after that, a Rebuild is enough to build the whole solution successfully.

I don't know how often users might come across this. But maybe the msbuild tip can be added to the docs. I was not aware that msbuild shows different errors than Visual Studio, that's interesting and great to know.

Thanks. This looks like a local configuration issue. If this folder does not exist, none of the package restore will work.

Did you add this package source explicitly ? Or did it happen after you installed an uno template ?

Yes, this is/was a local configuration issue. I mentioned this above, it's not related to Uno!

I think in the past I created that package source explicitly, and at some point I removed the folder but not the source configuration in Visual Studio. Interestingly I didn't notice it for a while, as I worked mostly in customer VMs due to the pandemic and I worked on local projects with a desktop PC. This error happened on my notebook that I didn't frequently use in the past

Thank you for your help!

Was this page helpful?
0 / 5 - 0 ratings