.NET for Android warning XA0122

Example messages

warning XA0122: Assembly 'Library1' is using a deprecated attribute '[assembly: Java.Interop.DoNotPackageAttribute]'. Use a newer version of this NuGet package or notify the library author.

Issue

The behavior implemented in the DoNotPackageAttribute is deprecated:

[assembly: Java.Interop.DoNotPackage ("foo.jar")]

This would prevent foo.jar from being packaged in the app.

Alternatively, you can use the @(AndroidExternalJavaLibrary) item group for including foo.jar. The java library will only be used at compile time, and will not be packaged in the final Android app.

Solution

Some libraries using this feature can be simply updated to a newer version on NuGet.

Library authors will need to remove usage of this attribute. Its functionality will be removed in a future release.