xamarin / AndroidSupportComponents

Xamarin bindings for Android Support libraries - For AndroidX see https://github.com/xamarin/AndroidX
MIT License
146 stars 56 forks source link

The attribute "xmlns" in element <UsingTask> is unrecognized. #121

Closed korzonkiee closed 6 years ago

korzonkiee commented 6 years ago

Microsoft Visual Studio Enterprise 2017 Version 15.8.7 VisualStudio.15.Release/15.8.7+28010.2046 Microsoft .NET Framework Version 4.7.03056 Mono Debugging for Visual Studio 4.11.11-pre (8fb558f) NuGet Package Manager 4.6.0

Xamarin 4.11.0.776 (d15-8@1ae9b59d7)

Xamarin.Android Version (eg: 6.0):

Xamarin.Android SDK 9.0.0.19 (HEAD/a8a3b0ec7)

Operating System & Version (eg: Mac OSX 10.11):

Windows 10 Pro Version 1803 (OS Build 17134.286)

Support Libraries Version (eg: 23.3.0):

28.0.0-preview1 and 28.0.0-preview2

Describe your Issue:

I'm attempting to add support libraries in version 28.0.0-preview* but error occurs.

Steps to Reproduce (with link to sample solution if possible):

I've been trying to reproduce it with newly created Xamarin.Android project, but I couldn't. It happens when I add those packages in existing project.

Include any relevant Exception Stack traces, build logs, adb logs:

The attribute "xmlns" in element \<UsingTask> is unrecognized. %HOME%\.nuget\packages\xamarin.android.support.annotations\28.0.0-preview1\build\monoandroid90\Xamarin.Android.Support.Annotations.targets

Content of the Xamarin.Android.Support.Annotations.targets file:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
  </ItemGroup>
  <ItemGroup>
  </ItemGroup>
<UsingTask AssemblyFile="Xamarin.Android.Support.BuildTasks.dll" TaskName="Xamarin.Android.Support.BuildTasks.VerifyVersionsTask" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
<Target Name="_VerifyXamarinAndroidSupportVersions" AfterTargets="ResolveAssemblyReferences" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <VerifyVersionsTask TargetFrameworkVersion="$(TargetFrameworkVersion)" TargetApiLevel="$(_AndroidApiLevel)" AndroidSdkBuildToolsVersion="$(AndroidSdkBuildToolsVersion)" ProjectExtensionsPath="$(MSBuildProjectExtensionsPath)" ProjectPath="$(MSBuildProjectDirectory)"></VerifyVersionsTask>
</Target>
</Project>
newky2k commented 6 years ago

@korzonkiee i'm assigning @Redth to investigate

Regards

PureWeen commented 6 years ago

I'm getting this error when trying to install the support libraries into a project that uses packages.config

PackageReference seems to work fine

A use case you can use to test this is to try and update the Xamarin Forms Android Platform project

https://github.com/xamarin/Xamarin.Forms/tree/master/Xamarin.Forms.Platform.Android

I tried to update it manually by updating the references in the csproj file by hand (setting monodroid81 path to monodroid90) but once I did that I can't compile it


1>H:\github\Xamarin.Forms\packages\Xamarin.Android.Support.Annotations.28.0.0-preview2\build\monoandroid90\Xamarin.Android.Support.Annotations.targets(12,131): error MSB4066: The attribute "xmlns" in element <UsingTask> is unrecognized.
Redth commented 6 years ago

Looks like when we merge together multiple .targets files from our source code, the extra xmlns attribute is getting appended to the 'merged' in elements. I think it's technically valid xml but obviously when using packages.config it's not ok.

Working on resolving this during the build, expect a -preview3 out soon.

Redth commented 6 years ago

Thanks, this is fixed in newer previews such as 28.0.0-preview5