xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

Build Error Xamarin Forms Android (monoandroid90) 3.6.0.293080 #5856

Closed mirvine-cobratechnology closed 5 years ago

mirvine-cobratechnology commented 5 years ago

Build error following an upgrade to Xamarin Forms 3.6.0.293080

Steps to Reproduce

  1. Manage Nuget Packages for Solution
  2. Upgrade all projects to Xamarin Forms 3.6.0.293080
  3. Clean and Build

Expected Behavior

Build without error

Actual Behavior

The following errors occur:

Severity Code Description Project File Line Suppression State Error Failed to generate resource table for split '' "Failed to generate resource table for split ''". Acwire.Fundraising.Android
Error Attribute "statusBarBackground" already defined with incompatible format. Acwire.Fundraising.Android C:\development\build\90\lp\55\jl\res\values\values.xml 6
Error Attribute "layout_anchorGravity" already defined with incompatible format. Acwire.Fundraising.Android C:\development\build\90\lp\55\jl\res\values\values.xml 10
Error Attribute "layout_dodgeInsetEdges" already defined with incompatible format. Acwire.Fundraising.Android C:\development\build\90\lp\55\jl\res\values\values.xml 17
Error Color types not allowed (at 'statusBarBackground' with value '#000000'). Acwire.Fundraising.Android C:\development\build\90\lp\55\jl\res\values\values.xml 17
Error Attribute "layout_insetEdge" already defined with incompatible format. Acwire.Fundraising.Android C:\development\build\90\lp\55\jl\res\values\values.xml 17

Basic Information

xleon commented 5 years ago

Exactly same thing here:

4>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1703,2): error APT0000: Failed to generate resource table for split '' "Failed to generate resource table for split ''".
4>C:\Users\xleon\Projects\MyProject\obj\Debug\81\lp\96\jl\res\values\values.xml(6): error APT0000: Attribute "statusBarBackground" already defined with incompatible format.
4>C:\Users\xleon\Projects\MyProject\obj\Debug\81\lp\102\jl\res\values\values.xml(2): error APT0000: Original attribute defined here.
4>C:\Users\xleon\Projects\MyProject\obj\Debug\81\lp\96\jl\res\values\values.xml(10): error APT0000: Attribute "layout_anchorGravity" already defined with incompatible format.
4>C:\Users\xleon\Projects\MyProject\obj\Debug\81\lp\102\jl\res\values\values.xml(2): error APT0000: Original attribute defined here.
4>C:\Users\xleon\Projects\MyProject\obj\Debug\81\lp\96\jl\res\values\values.xml(17): error APT0000: Attribute "layout_insetEdge" already defined with incompatible format.
4>C:\Users\xleon\Projects\MyProject\obj\Debug\81\lp\102\jl\res\values\values.xml(2): error APT0000: Original attribute defined here.
4>C:\Users\xleon\Projects\MyProject\obj\Debug\81\lp\96\jl\res\values\values.xml(17): error APT0000: Attribute "layout_dodgeInsetEdges" already defined with incompatible format.
4>C:\Users\xleon\Projects\MyProject\obj\Debug\81\lp\102\jl\res\values\values.xml(2): error APT0000: Original attribute defined here.
4>C:\Users\xleon\Projects\MyProject\obj\Debug\81\lp\96\jl\res\values\values.xml(17): error APT0000: Color types not allowed (at 'statusBarBackground' with value '#000000').

However it looks like this is coming from a combination of Xamarin.Forms + other libraries that use those properties. Probably those libraries need upgrading their android package references.

samhouts commented 5 years ago

Can you please attach a small project that demonstrates this issue? Thanks!

mirvine-cobratechnology commented 5 years ago

I created a new Empty project (PieTest) and updated the Android project to target Pie as well as update all nugets to the latest version. The project built and deployed ok. There are a lot less support library's referenced in the test project.

Probably best to try and identify the package that's causing the issue.

PieTest.zip

xleon commented 5 years ago

I finally got this fixed. It´s not Xamarin.Forms, but a problem in the csproj when upgrading to API 28:

https://stackoverflow.com/questions/55523996/xf-android-project-does-not-build-after-adding-xamarin-forms-visual-material-nug/55552972#55552972

It actually looks like a nuget.exe issue not updating csproj correctly.

IMO you should be able to close this issue @samhouts