googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.37k stars 1.08k forks source link

GADMediationAdapterFacebook failed to initialize #3600

Closed piascse10 closed 1 month ago

piascse10 commented 1 month ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

Following https://developers.google.com/admob/unity/mediation/meta to integrate Meta Audience Network but encountering adapter failed to initialize error message.

Failed: Adapter failed to initialize. Adapter raised an exception during setup.
Adapter: GADMediationAdapterFacebook, Exception: FBAdInitSettings is a final class and cannot be subclassed.
FBAdInitSettings

I am using Xcode 15.4 and here is the pod,

source 'https://cdn.cocoapods.org/'
source 'https://github.com/CocoaPods/Specs'

platform :ios, '12.0'

target 'UnityFramework' do
  pod 'FBSDKCoreKit', '~> 17.0.1'
  pod 'FBSDKCoreKit_Basics', '~> 17.0.1'
  pod 'FBSDKGamingServicesKit', '~> 17.0.1'
  pod 'FBSDKLoginKit', '~> 17.0.1'
  pod 'FBSDKShareKit', '~> 17.0.1'
  pod 'GoogleMobileAdsMediationAppLovin', '12.6.1.0'
  pod 'GoogleMobileAdsMediationFacebook', '6.15.2.0'
  pod 'Google-Mobile-Ads-SDK', '~> 11.5.0'
end
target 'Unity-iPhone' do
end
use_frameworks!

Possible duplicate: https://github.com/googleads/googleads-mobile-unity/issues/3355

piascse10 commented 1 month ago

Adding use_frameworks! :linkage => :static solved that issue but then I got new exception related to ApplovinSDK and FBSDKCoreKit. As they are dynamic linkage I add them in Unity-iPhone -> Linked Framework and Libraries. Finally its working.

takazawa-gg commented 1 month ago

I am facing the same problem. Do I need to make this change in the future? https://github.com/googleads/googleads-mobile-unity/issues/3600#issuecomment-2348429742

piascse10 commented 1 month ago

I am facing the same problem. Do I need to make this change in the future? #3600 (comment)

Sorry, I am not the repo owner. I just found a workaround that worked for me and I shared it here.

XOGamesHyoju commented 1 week ago

I'm experiencing the exact same issue with the Meta Unity package version 3.13.0. I wonder if there's any other way to make this initialize properly. I need to keep the use_frameworks! :linkage setting because I encountered problems with another plugin that caused the iOS build to fail when launching, which is related to this setting.

So, is there any alternative workaround available?