marcojak / MTAdmob

Admob plugin for Xamarin Android and iOS
https://www.xamarinexpert.it/admob-made-easy/
160 stars 26 forks source link

Updating to 2.1.0 Crashes Xamarin iOS Project #139

Closed PonyOny closed 9 months ago

PonyOny commented 9 months ago

Describe the bug when updating to the latest version it corrupts my iOs project, i can see it adds the following line to XXXX.iOS.csproj.nuget.g.targets

<Import Project="$(NuGetPackageRoot)xamarin.google.ios.usermessagingplatform\1.1.0.1\buildTransitive\Xamarin.Google.iOS.UserMessagingPlatform.targets" Condition="Exists('$(NuGetPackageRoot)xamarin.google.ios.usermessagingplatform\1.1.0.1\buildTransitive\Xamarin.Google.iOS.UserMessagingPlatform.targets')" />

this line makes my project not load and shows the following error

The imported project file "C:\nuget\xamarin.google.ios.usermessagingplatform\1.1.0.1\buildTransitive\Xamarin.Google.iOS.UserMessagingPlatform.targets" could not be loaded. The '_GoogleUserMessagingPlatformAssemblyName' start tag on line 3 position 6 does not match the end tag of '_GoogleMobileAdsAssemblyName'. Line 3, position 132.

To Reproduce Steps to reproduce the behavior: Update nuget to version 2.1.0

Expected behavior It should work as normal and not corrupt my iOS project

marcojak commented 9 months ago

Hi.

I'm aware of the issue (that is not related directly to the library but to a xamarin plugin) and I'm trying to solve it. Meanwhile, the solution is this: Open the file "C:\nuget\xamarin.google.ios.usermessagingplatform\1.1.0.1\buildTransitive\Xamarin.Google.iOS.UserMessagingPlatform.targets"

Replace the line

<_GoogleUserMessagingPlatformAssemblyName>Google.UserMessagingPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null with <_GoogleUserMessagingPlatformAssemblyName>Google.UserMessagingPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null That will fix the issue!
marcojak commented 9 months ago

What issue do you get with AutoFac? Can you post me the log or tell me how to reproduce it? So I can see if it's an issue with the plugin or not

On Wed, 7 Feb 2024, 18:38 PonyOny, @.***> wrote:

That works & project is loaded properly but this is causing issues with AutoFac, if I remove latest version all works as expected.

— Reply to this email directly, view it on GitHub https://github.com/marcojak/MTAdmob/issues/139#issuecomment-1932554790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUIPIWFVZHG47T2Z3D6YPDYSO3Z5AVCNFSM6AAAAABC6ET3KGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZSGU2TINZZGA . You are receiving this because you commented.Message ID: @.***>

PonyOny commented 9 months ago

It was my fault, did not add the new CrossMTAdmob.Current.Init(this, ...); and that made Autofac not be able to resolve, it's working now, on Android initialization it also requires the appId, this is the android appId i suppose no?

marcojak commented 9 months ago

Yes correct.

marcojak commented 9 months ago

Close as not an issue