Closed dmanning23 closed 1 month ago
Thank you, the suggestions in the 764 ticket solved that issue. I've had another similar issue come up when I add the following packages though:
<PackageReference Include="Xamarin.Google.Android.Play.Core">
<Version>1.10.3.14</Version>
</PackageReference>
<PackageReference Include="Xamarin.Google.Android.Play.Core.Common">
<Version>2.0.4.2</Version>
</PackageReference>
I'm working on a project where these 2 packages are added as transitive packages. These are the latest versions from Nuget, they are both published on the same day but the version numbers don't line up at all.
I've updated the example project to demonstrate these errors. When it is compiled, the following XA4215 errors are thrown:
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): warning XA4214: The managed type `Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListener` exists in multiple assemblies: Xamarin.Google.Android.Play.Core, Xamarin.Google.Android.Play.Core.Common. Please refactor the managed type names in these assemblies so that they are not identical.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): warning XA4214: References to the type `Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListener` will refer to `Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListener, Xamarin.Google.Android.Play.Core`.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): warning XA4214: The managed type `Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListenerImplementor` exists in multiple assemblies: Xamarin.Google.Android.Play.Core, Xamarin.Google.Android.Play.Core.Common. Please refactor the managed type names in these assemblies so that they are not identical.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): warning XA4214: References to the type `Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListenerImplementor` will refer to `Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListenerImplementor, Xamarin.Google.Android.Play.Core`.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): warning XA4214: The managed type `Xamarin.Google.Android.Play.Core.Common.IIntentSenderForResultStarter` exists in multiple assemblies: Xamarin.Google.Android.Play.Core, Xamarin.Google.Android.Play.Core.Common. Please refactor the managed type names in these assemblies so that they are not identical.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): warning XA4214: References to the type `Xamarin.Google.Android.Play.Core.Common.IIntentSenderForResultStarter` will refer to `Xamarin.Google.Android.Play.Core.Common.IIntentSenderForResultStarter, Xamarin.Google.Android.Play.Core`.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): error XA4215: The Java type `com.google.android.play.core.listener.StateUpdatedListener` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): error XA4215: `com.google.android.play.core.listener.StateUpdatedListener` generated by: Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListener, Xamarin.Google.Android.Play.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): error XA4215: `com.google.android.play.core.listener.StateUpdatedListener` generated by: Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListener, Xamarin.Google.Android.Play.Core.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): error XA4215: The Java type `mono.com.google.android.play.core.listener.StateUpdatedListenerImplementor` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): error XA4215: `mono.com.google.android.play.core.listener.StateUpdatedListenerImplementor` generated by: Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListenerImplementor, Xamarin.Google.Android.Play.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): error XA4215: `mono.com.google.android.play.core.listener.StateUpdatedListenerImplementor` generated by: Xamarin.Google.Android.Play.Core.Listener.IStateUpdatedListenerImplementor, Xamarin.Google.Android.Play.Core.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): error XA4215: The Java type `com.google.android.play.core.common.IntentSenderForResultStarter` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): error XA4215: `com.google.android.play.core.common.IntentSenderForResultStarter` generated by: Xamarin.Google.Android.Play.Core.Common.IIntentSenderForResultStarter, Xamarin.Google.Android.Play.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets(1536,3): error XA4215: `com.google.android.play.core.common.IntentSenderForResultStarter` generated by: Xamarin.Google.Android.Play.Core.Common.IIntentSenderForResultStarter, Xamarin.Google.Android.Play.Core.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Google deprecated Google.Android.Play.Core
and split its code into separate packages like Google.Android.Play.Core.Common
. Thus they contain the same code and cannot be used together. You will need to fully use one or the other.
https://developer.android.com/guide/playcore#playcore-migration
Xamarin.Android Version (eg: 6.0):
.net8.0-android
Operating System & Version (eg: Mac OSX 10.11):
Win11
Google Play Services Version
1xx.yyyy.zz
)xamarin.googleplayservices.auth 121.2.0.2
71.yyyy.zz
)Describe your Issue
Adding the xamarin.googleplayservices.auth package to a .Net Maui app causes compilation errors (see "build logs" section)
Relevant information
Add relevant project settings from
*.csproj
file:Packages used:
Minimal Repro Code Sample
https://github.com/dmanning23/GooglePlayServicesBug
Steps to Reproduce (with link to sample solution if possible):
Create a new .Net Maui app Add the xamarin.googleplayservices.auth nuget package The app no longer compiles
Include any relevant Exception Stack traces, build logs, adb logs: