jamesmontemagno / InAppBillingPlugin

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

Error in Visual Studio 2022 after Set Android API to 31 #472

Closed harrypotter06 closed 2 years ago

harrypotter06 commented 2 years ago

Version Number of Plugin: 4.02 Device Tested On: Samsung Simulator Tested On: Pixel 5 - API 31 Version of VS: 2022 Version of Xamarin: 17.2.0.175 (d17-2@e4ffdc0) Versions of other things you are using:

I have set a Android Projct (using VS 2022 with last patchlevel) from AP-Level 30 to API 31. After that (last Nudget Versions) i got a error from the Plugin.InAppBilling like that:

"J:\Visual Studio_tf\MyProject.csproj" (Build;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies Ziel) (1) -> 1>(_LinkAssembliesShrink Ziel) -> 1> C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: Mono.Linker.MarkException: Error processing method: 'Plugin.InAppBilling.InAppBillingPurchase Plugin.InAppBilling.Converters::ToIABPurchase(Android.BillingClient.Api.Purchase)' in assembly: 'Plugin.InAppBilling.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.String Android.BillingClient.Api.Purchase::get_Sku() 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.ProcessQueue() 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: --- Ende der internen Ausnahmestapelüberwachung --- 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.ProcessQueue() 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue() 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.Process() 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Steps.MarkStep.Process(LinkContext context) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Mono.Linker.Pipeline.Process(LinkContext context) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Xamarin.Android.Tasks.LinkAssemblies.RunTask() 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: bei Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:Zeile 17.

dnitsch commented 2 years ago

I had the same first error on plugin version 6.4.0, then realised I forgot to bump Xamarin.Adnroid.Google.Billing.Client from 3.x to 4.x. Version 4.0.2 has the same requirement - give that a go.

jamesmontemagno commented 2 years ago

This library automatically manages that reference for you, so shouldn't be an issue.

Please open a new ticket if so.