Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. #48

Closed
moljac opened this issue Jan 23, 2020 · 14 comments
Assignees

Comments

@moljac
Copy link
Member

moljac commented Jan 23, 2020

Xamarin.Android Version (eg: 6.0):

AndroidX

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

MacOSX builds on Azure DevOps

Support Libraries Version (eg: 23.3.0):

Describe your Issue:

Error

An error occurred when executing task 'migration-tests'.

Details

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(514,3): error XA0121: Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. [/Users/runner/runners/2.164.6/work/1/s/tests/AndroidXMigrationTests/Aarxercise.Old.Support/Aarxercise.Old.Support.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(514,3): error XA0121: Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. [/Users/runner/runners/2.164.6/work/1/s/tests/AndroidXMigrationTests/Aarxercise.Old.Support/Aarxercise.Old.Support.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(514,3): error XA0121: Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. [/Users/runner/runners/2.164.6/work/1/s/tests/AndroidXMigrationTests/Aarxercise.Old.Support/Aarxercise.Old.Support.csproj]

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

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

@moljac moljac self-assigned this Jan 23, 2020
@moljac
Copy link
Member Author

moljac commented Jan 24, 2020

error XA0121: Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.

Solved by bumping TargetFramework to latest.

Another solution was either to upgrade to 16.5 Preview 2 or downgrade to 16.3.

Closing.

@moljac moljac closed this as completed Jan 24, 2020
@jordanlui
Copy link

error XA0121: Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.

Solved by bumping TargetFramework to latest.

Another solution was either to upgrade to 16.5 Preview 2 or downgrade to 16.3.

Closing.

Moljac,
Can you elaborate on the fixes?
When you say TargetFramework, would I be following your suggestion if I install:
.NET Framework 4.8 targeting pack?

Thank you,
Jordan

@xleon
Copy link

xleon commented May 6, 2020

I can confirm the workaround (updating Android TargetFramework) works:
image

@lunjio
Copy link

lunjio commented Aug 14, 2020

The XA0121 warning from Xamarin.Android 10.1 is now an error because compatibility with the old GetAdditionalResourcesFromAssemblies MSBuild task has been removed.

Any project that uses one of the affected Xamarin.Android.Support libraries from version 26 or earlier will now see errors like:

Copy
error XA0121: Assembly 'Xamarin.Android.Support.Animated.Vector.Drawable' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.
To resolve these errors, update the project to use version 27 or higher of the Xamarin.Android.Support libraries.
Source - https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.2

@netstar-gh
Copy link

I have updated all Xamarin.Android.Support.* to v28.0.0.3 but still now working, This issue happen after I update the VS2019 to 16.7.2

Can you guys let me know how to fix it?

@netstar-gh
Copy link

Spending half a day and still struggling, VS updated and NuGet as well but everything still failing to build

@netstar-gh
Copy link

image

@HUBBER12
Copy link

HUBBER12 commented Nov 8, 2020

Me too.. mine is Xamarin.Android.Support.CustomTabs and Xamaarin.Android.Support.v4.
Have VS 16.7.7.

@HUBBER12
Copy link

HUBBER12 commented Nov 8, 2020

So update - i had not realized i needed to start using AndroidX istead of all the Xamarin.Android.Support.

I have gotten rid of all Xamarin.Android.Support.xxxxx nuget packages...
and now I'm using all Xamarin.AndroidX.... nuget packages

however i get error messages all very close to

Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author

I have gone through each package, and I cant quite find what is referencing it so i can remove/replace.

VS 16.7.7 on PC

Additionally - I have Target Framework = 10.0 in both places referenced. Min and Target are both set to 10.

@guillermo-gerard
Copy link

I'm in the same situation as you @HUBBER12 but I'm using VS 16.7.5 , targetting v11.0.
I see 3 errors (all of them are the same), but there are no pointers to which library is referencing the support libraries /causing the errors. So frustrating :(

@ashlar64
Copy link

ashlar64 commented Feb 1, 2021

Did you guys find a solution to this?

@MichaelRodrigueess0s1
Copy link

i had a some fuking problem!!

@xleon
Copy link

xleon commented Jul 14, 2022

Indeed you have a problem. Throwing that kind of offensive and useless comments here does not help anyone.
If you don't have anything to add to the conversation, why even bothering?

@moljac
Copy link
Member Author

moljac commented Jul 15, 2022

Indeed you have a problem. Throwing that kind of offensive and useless comments here does not help anyone. If you don't have anything to add to the conversation, why even bothering?

Thank you very much. Appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants