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. #112

Closed
TruongCa95 opened this issue Jun 9, 2020 · 18 comments
Assignees

Comments

@TruongCa95
Copy link

I reference #48 but not working
something wrong?

@moljac
Copy link
Member

moljac commented Jun 13, 2020

Did you try bumping TargetFramework?

@TruongCa95
Copy link
Author

yes, but if I change TargetFramework to v9.0 not v10.0 then it's normal, why?
Is androidx on android 10 incomplete?

@moljac
Copy link
Member

moljac commented Jun 14, 2020

This has nothing to do with AndroidX. Something is pulling in Android.Support dependencies and this attribute is from Android.Support

@moljac moljac self-assigned this Jun 16, 2020
@DennisWelu
Copy link

Just getting around to updating from 9 to 10 as the target and I'm seeing the same errors. Was otherwise reading and following along with the required changes in this article: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/android/androidx-migration.

@TruongCa95
Copy link
Author

Just getting around to updating from 9 to 10 as the target and I'm seeing the same errors. Was otherwise reading and following along with the required changes in this article: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/android/androidx-migration.

I changed from 10 to 9 and it resolved. I just don't understand why?

@DennisWelu
Copy link

Updated all nugets, and had to pull the code for one of them directly in to the solution (https://github.com/EgorBo/Toasts.Forms.Plugin) because it's not being maintained...and somewhere in that process things are now building/running.

@moljac
Copy link
Member

moljac commented Jul 1, 2020

@DennisWelu
Thanks for the feedback. Appreciated and helped a lot.

Geez these references are old like me:

https://github.com/EgorBo/Toasts.Forms.Plugin/blob/master/Toasts.Forms.Plugin.Droid/Toasts.Forms.Plugin.Droid.csproj#L51-L73

This is something we cannot predict and easily solve.

@DennisWelu
Copy link

@moljac LOL, well....I spoke too soon. We had updated the target SDK but forgot to update the "compile using" setting to match... And when that happened the errors returned. Problem solving is still underway - will update with more info when we know something further!

@jimiatnymbl
Copy link

We started to receive this error today after we upgraded to the latest Xamarin.Forms. However, it appears to be one of the plugins (Xam.Plugins.Notifier) that is still referencing Xamarin.Android.Support.v4. I have opened an issue for that project here:

edsnider/localnotificationsplugin#69

@lunjio
Copy link

lunjio commented Aug 14, 2020

We started to receive this error today after we upgraded to the latest Xamarin.Forms. However, it appears to be one of the plugins (Xam.Plugins.Notifier) that is still referencing Xamarin.Android.Support.v4. I have opened an issue for that project here:

edsnider/localnotificationsplugin#69

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

@DennisWelu
Copy link

Following up on my previous post, the other Nuget that we didn't realize was pulling in Android.Support dependencies was the ZXing library. Updated to use the Beta prerelease created earlier this year and that solved the problem.

@lunjio
Copy link

lunjio commented Aug 14, 2020

Following up on my previous post, the other Nuget that we didn't realize was pulling in Android.Support dependencies was the ZXing library. Updated to use the Beta prerelease created earlier this year and that solved the problem.

I had the same error message with Xamarin.Android.Support.CustomTab package, installing manually library in project solved the issue.

@Shwabster
Copy link

Shwabster commented Oct 5, 2020

Is there any fix or work around to this issue? My project was developed a long time ago and last built using VS 2017 and Target Framework 6, I have since updated to VS 2019 and have updated Xamarin.Forms to the latest version and the Target Framework to 9 (And 10) and am receiving the error:

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.

@jpobst
Copy link
Contributor

jpobst commented Oct 21, 2020

It sounds like the available fixes are:

  • Use version 27 or higher of the Xamarin.Android.Support libraries
  • Use TargetFramework of 9
  • Migrate to AndroidX

Google has deprecated the Android Support libraries in favor of AndroidX, so I would not expect to see any future updates to them.

@guillermo-gerard
Copy link

Wow!, I hit this error after updating all the nuget packages in the project. I'm using AndroidX, the last version of the Support libraries (28.x) and targeting v11.0
Any ideas on how to fix it?
These nuget and dependency issues are an infinite source of frustration :(

@DennisWelu
Copy link

I can't tell you a specific fix, but I know the web of dependencies through the nuget packages can easily lead you to pulling in an unexpected older version of something. That's the best I can think of is to carefully go through that dependency tree and look for that situation. Wish I could help more!

@ARLeandroC
Copy link

I'm having this problem with an Android Library which I'm migrating to Xamarin. I tried to remove all the packages with dependency on Android.Support.* libraries, but I'm still getting these errors. Is there a way to check which of my packages are dependent on the Support libraries? Or is it better to add the version 27 of the Android.Support libraries?

I'd appreciate your help, I have no idea how to fix this, anymore.

@jpobst
Copy link
Contributor

jpobst commented May 24, 2022

Closing this as the Android Support Libraries have been deprecated for ~3 years. The fix for this is to fully migrate to AndroidX and ensure that no Android Support libraries are referenced by your project or your project's dependencies.

@jpobst jpobst closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2022
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