xamarin / GooglePlayServicesComponents

Other
315 stars 148 forks source link

Xamarin.Firebase.Messaging 123.3.1.2 doesn't work with .NET 8 (Repro included) #855

Closed inimirpaz closed 5 months ago

inimirpaz commented 6 months ago

Xamarin.Android Version (eg: 6.0):

Version: 13.2.2.0 (Visual Studio Professional) (.NET 8.0.14 Android actually)

Operating System & Version (eg: Mac OSX 10.11):

MacOS 14.1.1

Describe your Issue

NuGet package Xamarin.Firebase.Messaging cannot be upgraded (from 123.3.1.1) to 123.3.1.2:

(complete logfile: log_complete.txt )

See Log ``` [...] Checking compatibility of packages on net8.0-ios17.2 (android-x86). Checking compatibility for FirebaseNetEightIssue 1.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Extensions.Logging.Debug 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Maui.Controls 8.0.14 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Maui.Controls.Compatibility 8.0.14 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.NET.ILLink.Tasks 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Xamarin.Firebase.Messaging 123.3.1.2 with net8.0-ios17.2 (android-x86). Package Xamarin.Firebase.Messaging 123.3.1.2 is not compatible with net8.0-ios17.2 (.NETCoreApp,Version=v8.0) / android-x86. Package Xamarin.Firebase.Messaging 123.3.1.2 supports: - monoandroid12.0 (MonoAndroid,Version=v12.0) - net6.0-android31.0 (.NETCoreApp,Version=v6.0) - net7.0-android33.0 (.NETCoreApp,Version=v7.0) Checking compatibility for Microsoft.Extensions.DependencyInjection.Abstractions 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Extensions.Logging.Abstractions 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Extensions.Logging 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Maui.Controls.Build.Tasks 8.0.14 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Maui.Controls.Core 8.0.14 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Maui.Controls.Xaml 8.0.14 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Maui.Resizetizer 8.0.14 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Extensions.Configuration 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Extensions.DependencyInjection 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Extensions.Options 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Maui.Core 8.0.14 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Extensions.Configuration.Abstractions 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Extensions.Primitives 8.0.0 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Maui.Essentials 8.0.14 with net8.0-ios17.2 (android-x86). Checking compatibility for Microsoft.Maui.Graphics 8.0.14 with net8.0-ios17.2 (android-x86). Incompatible packages: 1 Checking compatibility of packages on net8.0-ios17.2 (iossimulator-x64). Checking compatibility for FirebaseNetEightIssue 1.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Extensions.Logging.Debug 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Maui.Controls 8.0.14 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Maui.Controls.Compatibility 8.0.14 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.NET.ILLink.Tasks 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Xamarin.Firebase.Messaging 123.3.1.2 with net8.0-ios17.2 (iossimulator-x64). Package Xamarin.Firebase.Messaging 123.3.1.2 is not compatible with net8.0-ios17.2 (.NETCoreApp,Version=v8.0) / iossimulator-x64. Package Xamarin.Firebase.Messaging 123.3.1.2 supports: - monoandroid12.0 (MonoAndroid,Version=v12.0) - net6.0-android31.0 (.NETCoreApp,Version=v6.0) - net7.0-android33.0 (.NETCoreApp,Version=v7.0) Checking compatibility for Microsoft.Extensions.DependencyInjection.Abstractions 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Extensions.Logging.Abstractions 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Extensions.Logging 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Maui.Controls.Build.Tasks 8.0.14 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Maui.Controls.Core 8.0.14 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Maui.Controls.Xaml 8.0.14 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Maui.Resizetizer 8.0.14 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Extensions.Configuration 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Extensions.DependencyInjection 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Extensions.Options 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Maui.Core 8.0.14 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Extensions.Configuration.Abstractions 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Extensions.Primitives 8.0.0 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Maui.Essentials 8.0.14 with net8.0-ios17.2 (iossimulator-x64). Checking compatibility for Microsoft.Maui.Graphics 8.0.14 with net8.0-ios17.2 (iossimulator-x64). Incompatible packages: 1 Package restore failed. Rolling back package changes for 'FirebaseNetEightIssue'. ```

Also, Xamarin.AdnroidX.Fragment.Ktx must be explicitly included to be able to build version 123.3.1.1 (which it DOES work with .NET 8):

    <ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
      <PackageReference Include="Xamarin.Firebase.Messaging" Version="123.3.1.1" />
      <PackageReference Include="Xamarin.AndroidX.Fragment.Ktx" Version="1.6.2.2" />
    </ItemGroup>

Minimal Repro Code Sample

See attachment FirebaseNetEightIssue.zip

jpobst commented 6 months ago

Do you get this while trying to update the Nuget version via a Nuget UI? My guess is that their tooling does not support the Condition.

If you just update the version in the .csproj manually, does it work?

inimirpaz commented 6 months ago

Do you get this while trying to update the Nuget version via a Nuget UI? My guess is that their tooling does not support the Condition.

If you just update the version in the .csproj manually, does it work?

Thank you for your reply. You are right, updating the version in the .csproj did the trick. (At least in the repro project, I thought I had tried it already in the production project but I guess I did not, or encountered some other issue) Should this issue be moved to another github?

jpobst commented 5 months ago

I think the NuGet team is aware of this and are tracking it here (among other places).