Hi @Kim Strasser ,
Thanks for reaching out.
From the details you shared, it looks like your build is failing because the class androidx.compose.runtime.Immutable is defined in two different packages at the same time: one in the Android-specific artifact (runtime-annotation-android.aar) and one in the JVM artifact (runtime-annotation-jvm.jar). When the Android build system tries to compile, it sees both copies and doesn’t know which one to use, which causes the JAVA0000 error.
This usually happens after updating MAUI workloads and NuGet packages because some Compose runtime packages get pulled in for both Android and JVM targets. In most MAUI projects, you only need the Android artifacts, so the JVM ones can safely be removed.
Here’s what you can do:
- Remove unnecessary Compose packages - in your NuGet references, check for any
Xamarin.AndroidX.Compose.*packages, especially the-JVMones, and remove them if your project doesn’t need Compose UI. Keep only the Android-specific packages. - Clear NuGet caches - old cached packages can sometimes conflict. You can run:
Then restore your packages.dotnet nuget locals all --clear - Align package versions - make sure all AndroidX and Compose packages use the same version to avoid version mismatches.
- Clean and rebuild - delete
binandobjfolders, then do a full rebuild in Visual Studio (Build -> Clean Solution -> Rebuild Solution). - Verify your MAUI workloads (optional) - since this happened after updating, it’s a good idea to check that your workloads are fully up-to-date and repaired:
dotnet workload list dotnet workload repair
Optional: if some transitive dependency still brings in the JVM artifact, you can exclude it in your .csproj like this:
<PackageReference Include="Xamarin.AndroidX.Compose.Runtime.Annotation.JVM" Version="1.10.0.1">
<ExcludeAssets>runtime;build</ExcludeAssets>
</PackageReference>
Following these steps usually resolves the duplicate class issue and gets your MAUI Android project building again.
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.