Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

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

Open
blmiles opened this issue Apr 20, 2020 · 15 comments
Open

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

blmiles opened this issue Apr 20, 2020 · 15 comments

Comments

@blmiles
Copy link

blmiles commented Apr 20, 2020

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
Copy link
Contributor

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
Copy link
Author

blmiles commented Apr 30, 2020

@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
Copy link
Contributor

@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
Copy link
Author

blmiles commented Apr 30, 2020

@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

@Redth Redth removed the needs-info label Apr 30, 2020
@erhanalankus
Copy link

erhanalankus commented May 25, 2020

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

  • Create a new Xamarin.Forms project.
  • Deploy to iPhone, it works.
  • Add "Xamarin.Google.iOS.MobileAds" nuget package to the iOS project.
  • Try to deploy to iPhone, it fails with native linking errors.
  • Add var t = Firebase.Core.Configuration.SharedInstance; (@SotoiGhost ) to the FinishedLaunching method(before Init()) in AppDelegate.cs, deploying to iPhone fails with a package inspection failed error error MT1006: Could not install the application '/Users/erhan/Library/Caches/Xamarin/mtbs/builds/App3.iOS/dc165bdc93b2cf601d2bf3e34e17376a/bin/iPhone/Debug/App3.iOS.app' on the device 'Erhan iPhone???u': Package Inspection Failed Error (error: 0xe8000051). There's also this line in the output window 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; Extra info about plist: ACL=<not found>.

@shpand
Copy link

shpand commented Aug 4, 2020

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
Copy link

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
Copy link

Are there any updates on this?

@StoatsOnAPlane
Copy link

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
Copy link

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

@assassin316
Copy link

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

@TomParonis
Copy link

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
Copy link

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

ionixjunior added a commit to ionixjunior/AdMobSamples that referenced this issue Apr 9, 2021
Isso foi necessário pois a biblioteca do AdMob precisa de algumas funcionalidades do Firebase.Core. No entanto, por não ser referenciado, o linker remove o AppMeasurement e faz a aplicação não compilar.

Este workaround foi encontrado em xamarin/GoogleApisForiOSComponents#397 (comment).
@assassin316
Copy link

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

@mgkcorty
Copy link

mgkcorty commented Jul 21, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants