jamesmontemagno / InAppBillingPlugin

Cross-platform In App Billing Plugin for .NET
MIT License
637 stars 152 forks source link

Unable to build in MAUI RC1 #462

Closed pfiggins closed 2 years ago

pfiggins commented 2 years ago

Bug Information

Version Number of Plugin: 6.3.2-beta Device Tested On: None Simulator Tested On: None Version of VS: 2022 17.2.0 Preview 3 Version of Xamarin: MAUI RC1 Versions of other things you are using:

Steps to reproduce the Behavior

Update VS 2022 to 17.2.0 Preview 3 Create a new MAUI Blazor app from template Add Plugin.InAppBilling from Nuget Build project

Expected Behavior

Successful build. (Worked fine in preview 14)

Actual Behavior

Failed build with the following error - "com.google.common.util.concurrent.ListenableFuture is defined multiple times" Full build output - https://gist.github.com/pfiggins/c5bd00980b20be9252228378a993c880

jamesmontemagno commented 2 years ago

Hey @Redth do we need a new BillingClient compiled against .NET 6?

jamesmontemagno commented 2 years ago

@jonathanpeppers?

Redth commented 2 years ago

Yes!

jamesmontemagno commented 2 years ago

:) also there were some changes in essentials namespaces so I will have to create a new package anyways for this :)

jonathanpeppers commented 2 years ago

I think the problem above is an issue in:

https://www.nuget.org/packages/Xamarin.Google.Guava.ListenableFuture/1.0.0.5

When using that package it accidentally redistributed a .jar file with your NuGet package. Users of the package can end up with two.

If you recompile with the newer one:

https://www.nuget.org/packages/Xamarin.Google.Guava.ListenableFuture/1.0.0.6

I think the problem would be solved.

jamesmontemagno commented 2 years ago

@pfiggins you can try to manually add this to yours. I will be trying to add it into the next release, but having issues currently with CI so may take a bit of time.

pfiggins commented 2 years ago

Thanks @jamesmontemagno. Appreciate the responsiveness! We're still dead in the water due to RC1 incompatibility with Xamarin.Firebase.Messaging as well, so it seems there's no rush until someone even takes a look at that one... I don't have high hopes since it hasn't been touched in 18 days 😒 https://github.com/xamarin/GooglePlayServicesComponents/issues/595.

I just can't believe there's no way to downgrade the MAUI workload to preview 14 or VS Preview back to 2.1. It feels like a regression to have MAUI so tightly coupled with VS and no way to control the versioning. And certainly killing our team productivity, since there's only one lucky guy who didn't update to RC1 before we noticed the issues.

jamesmontemagno commented 2 years ago

You can easily downgrade by pinning to a specific version of .NET that you have insatlled.

You can also set the <MauiVersion> in your csproj

pfiggins commented 2 years ago

That's what I thought, but there are so many moving pieces, that it doesn't seem to work in practice. I have the sdk pinned with a global.json -

{
  "sdk": {
    "version": "6.0.300-preview.22154.4"
  }
}

and MauiVersion in the csproj pinned to the last version we had successful builds with - <MauiVersion>6.0.200-preview.14.5099</MauiVersion>

The sdk version is the same we've been using for a while now, in order to get successful builds in VS Preview 2.1. Either way, it blows chunks when I try to build. I suspect it may be because the actual MAUI workload installed on my machine is the one from VS Preview 4 and that's not the one I'm pinning. Just a total guess, but I can't think of why else it wouldn't be working...

6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(4,37,4,50): error CS0234: The type or namespace name 'Accessibility' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(5,37,5,53): error CS0234: The type or namespace name 'ApplicationModel' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(6,37,6,53): error CS0234: The type or namespace name 'ApplicationModel' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(7,37,7,53): error CS0234: The type or namespace name 'ApplicationModel' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(8,37,8,51): error CS0234: The type or namespace name 'Authentication' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(12,37,12,44): error CS0234: The type or namespace name 'Devices' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(13,37,13,44): error CS0234: The type or namespace name 'Devices' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(16,37,16,42): error CS0234: The type or namespace name 'Media' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(17,37,17,47): error CS0234: The type or namespace name 'Networking' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
6>C:\projects\appname\src\Appname.Maui\obj\Debug\net6.0-android\Appname.Maui.GlobalUsings.g.cs(18,37,18,44): error CS0234: The type or namespace name 'Storage' does not exist in the namespace 'Microsoft.Maui' (are you missing an assembly reference?)
jamesmontemagno commented 2 years ago

You may need to do a full clean and delete obj/bin because the global usings changed in RC1 as the .net maui namespaces changed as well.

pfiggins commented 2 years ago

Yeah, that's my usual go to fix for xamarin/maui. No luck. I even tried removing VS Preview, repairing regular VS, then reinstalling VS Preview this morning. Still broken. If pinning both of those works for others, then it must be local to something here. Something is out of whack, but lord knows what at this point... I'll check with the rest of my team and see if pinning MAUI works for them. Either way, thanks for your suggestions!

sunflower098 commented 2 years ago

I have the same issue then fixed by using PlugIn version 5.3.2-beta, which may reason to conflict Essentials with the last MAUI version. So far it working with me. Just remove the obj folder before rebuilding my code. Hope this helps.

jamesmontemagno commented 2 years ago

pushing new package