Search code examples
javaandroidxamarinxamarin.forms

The Java Type is Generated by More Than One Managed Type


I'm currently trying to build a cross-platform app with Xamarin Forms. The app was working until I started receiving the error:

Error The Java type mono.com.google.android.gms.common.api.PendingResult_StatusListenerImplementor is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. BlueApp.Android

I have 36 of these errors each with a problem with a different Java type. I checked the Microsoft documentation for it, and it tells me to "change the [Register] attribute on one of the C# types to a different Java type name". Not sure how to do this if this is how you fix my errors. Thanks for the help in advance.


Solution

  • I realized what the problem was. The error message was telling me that the java type mono.com.google.android.gms.common.api.PendingResult_StatusListenerImplementor along with all the other java types in the other error messages was being generated by multiple managed types.

    Essentially, this issues stemmed from having both Xamarin.GooglePlayServices.Base and Xamarin.GooglePlayServices.Basement packages installed along with GooglePlayServices.Base and GooglePlayServices.Basement. To fix the issue, I uninstalled the GooglePlayServices packages and kept the Xamarin.GooglePlayServices packages.