Resolving Runtime Reference Errors in Xamarin.Android Native Project After .NET 7 Migration

Dominik 0 Reputation points
2023-11-10T10:18:55.3033333+00:00

Hello,

I'm seeking assistance with an issue we're encountering in our Xamarin.Android native project (not Xamarin.Forms). Our project is quite large, comprising an Android app project along with multiple Android library projects and class libraries, all referenced within the Android app project. We utilize a microkernel architecture and heavily rely on reflection.

Since migrating our projects to .NET 7, we've faced significant challenges: references and DLLs are not being found at runtime. It seems that references not immediately used, but instead invoked later through reflection, are being erroneously removed before deployment. We've experimented with various linking options and ProGuard settings, but these efforts have not resolved the issue.

Any insights or suggestions from those with experience in this area would be greatly appreciated. Thank you !

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,362 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,579 questions
Microsoft Intune Android
Microsoft Intune Android
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Android: An open-source mobile platform based on the Linux kernel, developed by Google, and maintained by the Open Handset Alliance.
299 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.