Forum Xamarin.Android


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Android build fails "package androidx.recyclerview.widget does not exists" in msbuild, works in IDE

Hi There!

Project using targetFrameworkVersion 10, aapt2 and also uses some androidx packages.

It compiles well from the VS 2019 IDE in debug & release.

But on CI and also on my local machine when using msbuild(with the correct parameters, it works on earlier commits) am getting the following error roughly 2000x with a lot different sdk views:
obj\Release\100\android\src\crc643f46942d9dd1fff9\,38): javac.exe error JAVAC0000: error: package androidx.recyclerview.widget does not exist

Although the xamarin.androidx.recyclerview nuget package has been added to the project.

Disabled proguard but have not changed anything.
Added every piece of androidx packages for testing, did not work.

Is it a bug in msbuild or the IDE is buggy or something else is going on i missed?

I hope someone has an idea :)


Microsoft Visual Studio Professional 2019
Version 16.7.6
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Professional

Xamarin ([email protected])
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer (remotes/origin/[email protected])
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.7.85 (1bcbbdf)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK (d16-7/025fde9)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: 83105ba
Java.Interop: xamarin/java.interop/[email protected]
ProGuard: Guardsquare/proguard/[email protected]
SQLite: xamarin/sqlite/[email protected]
Xamarin.Android Tools: xamarin/xamarin-android-tools/[email protected]

Xamarin.iOS and Xamarin.Mac SDK (7ec3751a1)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.


  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Please check the Linking option, when you set the linking to None like following screenshot, if you have this issue.

  • William.4025William.4025 USMember ✭✭

    Thank you for your response!

    It was on SDK only, after changing it to None i got other errors:

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1768,3): error XA4215: The Java type is generated
    by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted.

    I assume it has something to do with : ?

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    after changing it to None i got other errors:

    That is wired, if you set it to none, all of the nuget packages will not be moved. it is the same as you debug the application. When you debug your application, is that work?

  • William.4025William.4025 USMember ✭✭

    No, i am getting the error above in every configuration when linking is turned : .. ..
    I dont use any xamarin.androidx or older packages directly.

    But as i see this is a very old issue that has not been fixed yet of course :D

Sign In or Register to comment.