Can't archive app in Release configuration while targeting Android Q

Hi all.

I'm trying to archive (Build > Archive for Publishing) our app using the latest supported Target Framework --as of today that is Xamarin.Android 9.4 / Android "9.0.99" (Q)--, but the build always fails with different errors depending on the specific project settings applied. For instance, if the Linker is enabled (either for All Assemblies or just for SDK assemblies), the build fails with:

error MSB4018: The "LinkAssemblies" task failed unexpectedly. System.IO.FileNotFoundException: Could not load assembly 'MyApp, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?

If the Linker is disabled in the project ("Don't link") the build fails with:

error MSB4018: The "FilterAssemblies" task failed unexpectedly. System.IO.FileNotFoundException: Could not load assembly 'MyApp, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?

In both cases, I can't see any previous errors, but a lot of warnings about the Xamarin Android Support libraries, for instance:

PackageId: Xamarin.Android.Support.ViewPager (28.0.0.1) is only compatible with TargetFrameworkVersion: MonoAndroid,v9.0 (Android API Level 28) You should either install the right package versions, or update your project's TargetFrameworkVersion to match the version your packages are designed to be used with.

But turns out version 28.0.0.1 is the latest version available in NuGet for the Xamarin Android Support Libraries.

I found a lot of posts (both in the Xamarin.Forms forums, as well as open issues in the Xamarin.Android GitHub repo page), but neither of the solutions / workarounds suggested work for us. Interestingly, running the apps in Debug and Release configuration DOES work.

Is targeting Android Q / 10 actually supported at this stage for Xamarin.Android apps? Is it recommended to keep targeting Android 9 (Xamarin Android 9.3) in the meantime?

Sign In or Register to comment.