xamarin / GoogleApisForiOSComponents

MIT License
225 stars 162 forks source link

Native linking failed, again! iOS, Xamarin.Forms, Admob... #397

Open blmiles opened 4 years ago

blmiles commented 4 years ago

For those interested, I have the latest VS 2019 version (16.5.4), the latest XCode version (11.4.1) with iOS versions too. Building a Xamarin.Forms project, targeting Android and iOS.

If I include the latest Xamarin.Google.iOS.MobileAds (7.57.0) along with required dependencies (Firebase), I get this "failed to resolve ObjCRuntime.TrampolineBlockBase" too, along with 47 other build/compile errors for iOS.

If I exclude those plugin libraries, my iOS app compiles and runs just fine.

No build errors for Android.

It would be great to know what versions of these relevant plugins to include so that all is compatible with the other AND with the latest mono framework!

Someone building Xamarin.Google.iOS.MobileAds & the related firebase plugins dropped the ball.

SOMEONE NEEDS TO REOPEN THIS - Native linking failed #158

SotoiGhost commented 4 years ago

Hi @blmiles! Thanks for reporting this and an apology for the inconveniences that this could cause.

Are you using Firebase packages somehow inside of your app?

blmiles commented 4 years ago

@SotoiGhost thanks for responding.

No, I'm not using any Firebase packages at all. I've tried various permutations with Xamarin.Google.iOS.MobileAds. Some forums say to install xamarin.firebase.iOS plugin to negate errors but I found that just produced even more errors. So I abandoned that, removed all related packages and put it aside for now. Ads have to wait.

SotoiGhost commented 4 years ago

@blmiles Please, use Firebase.Core somehow within your app, that should fix the linker errors, e.g:

var t = Firebase.Core.Configuration.SharedInstance;

Google Mobile Ads needs some dependencies that Firebase Core uses but if F.Core is not referenced somehow, the whole package is stripped by the linker.

Let me know you results.

blmiles commented 4 years ago

@SotoiGhost thanks for quick response. I'll add that to the AppDelegate and see what happens. Probably only next week, please keep this open for a while.

Thx

erhanalankus commented 4 years ago

I'm having the same issue. Steps to reproduce:

shpand commented 4 years ago

can confirm this: latest Xamarin.Google.iOS.MobileAds version (7.57.0) fails with error

PackageInspectionFailed: Failed to load Info.plist from bundle at path /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.zRcsX3/extracted/App3.iOS.app/Frameworks/PersonalizedAdConsent.framework

If I remove Xamarin.Google.iOS.MobileAds from my project or downgrade it to 7.19.0 everything works fine

assassin316 commented 4 years ago

I can also confirm that I receive Linking Failures when simply referencing the Xamarin.Google.iOS.MobileAds nuget in my project. This issue seems to have started occurring since 7.47.0 which is the first version to depend on Firebase:

7.47.0 image

7.38.0 image

Referencing 7.38.0 builds successfully.

kshumon2000 commented 4 years ago

Are there any updates on this?

StoatsOnAPlane commented 4 years ago

What is your Supported Architectures set to? I was able to get release mode build by changing it from ARMv7 + ARMv7s + ARM64 to just ARM64

assassin316 commented 4 years ago

@StoatsOnAPlane Supported Architectures for me has always only been ARM64.

assassin316 commented 3 years ago

@SotoiGhost has there been any update from the team on this issue?

TomParonis commented 3 years ago

I have been having this same issue and it has been driving me mad. My app is up on Google Play with AdMob and it worked seamlessly. My paid Apple app is also working but I am simply unable to add AdMob to Xamarin iOS. I can run it in debug mode but the only way I can build a release version for archiving is by specifying --registrar:dynamic but then I can't get the bundle version because of extra standalone libs. This is beyond frustrating and seems to demonstrate that you can't get Xamarin iOS working with AdMob in release version. If anyone could lead me out of this morass I'd happily pay them for their time as this has cost me 2 weeks of my life and a chunk of my mental health. This is the message I get with this little Hello World app and my more complicated app.

Screen Shot 2021-03-24 at 1 38 04 PM

image

TomParonis commented 3 years ago

Whoops; wrong screenshot. Here's the right one. image

assassin316 commented 3 years ago

This issue has been dragging on for way too long. Is anyone from the Xamarin team going to respond??

mgkcorty commented 3 years ago

Same issue. Any updates? Temporary workaround select ARM64 arch only.