facebook / facebook-sdk-for-unity

The facebook sdk for unity.
https://developers.facebook.com/docs/unity
Other
489 stars 256 forks source link

17.0 build failed #720

Open stzseungmokyun opened 5 months ago

stzseungmokyun commented 5 months ago

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Code Samples & Details

I get the following error when building xcode. Build succeeds when downgrading Facebook SDK 15.1

ld: warning: ignoring duplicate libraries: '-lc++'
ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
ld: Undefined symbols:
  _GADAdLoaderAdTypeNative, referenced from:
      ___73-[ALGoogleMediationAdapter loadAdViewAdForParameters:adFormat:andNotify:]_block_invoke in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
      ___64-[ALGoogleMediationAdapter loadNativeAdForParameters:andNotify:]_block_invoke in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _GADAdSizeBanner, referenced from:
      -[ALGoogleMediationAdapter adSizeFromAdFormat:isAdaptiveBanner:parameters:] in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
      -[ALGoogleMediationAdapter adSizeFromAdFormat:isAdaptiveBanner:parameters:] in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _GADAdSizeLeaderboard, referenced from:
      -[ALGoogleMediationAdapter adSizeFromAdFormat:isAdaptiveBanner:parameters:] in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _GADAdSizeMediumRectangle, referenced from:
      -[ALGoogleMediationAdapter adSizeFromAdFormat:isAdaptiveBanner:parameters:] in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth, referenced from:
      ___75-[ALGoogleMediationAdapter adSizeFromAdFormat:isAdaptiveBanner:parameters:]_block_invoke in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
      +[ALGoogleMediationAdapter currentOrientationAchoredAdaptiveBannerSizeWithWidth:] in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _GADGetStringFromVersionNumber, referenced from:
      -[ALGoogleMediationAdapter SDKVersion] in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADAdLoader, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADAppOpenAd, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADBannerView, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADExtras, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADInterstitialAd, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADMediaView, referenced from:
       in libGoogleAdapter.a[3](ALGoogleNativeAdDelegate.o)
  _OBJC_CLASS_$_GADMobileAds, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADNativeAdImageAdLoaderOptions, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADNativeAdView, referenced from:
       in libGoogleAdapter.a[7](ALGoogleNativeAd.o)
  _OBJC_CLASS_$_GADNativeAdViewAdOptions, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADQueryInfo, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADRequest, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADRewardedAd, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
  _OBJC_CLASS_$_GADRewardedInterstitialAd, referenced from:
       in libGoogleAdapter.a[10](ALGoogleMediationAdapter.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is my pod file

platform :ios, '12.0'

target 'UnityFramework' do
  pod 'AppLovinMediationFacebookAdapter', '6.15.0.0'
  pod 'AppLovinMediationGoogleAdapter', '11.3.0.0'
  pod 'AppLovinSDK', '12.4.1'
  pod 'AppsFlyerFramework', '6.13.0'
  pod 'FBSDKCoreKit', '~> 17.0.0'
  pod 'FBSDKCoreKit_Basics', '~> 17.0.0'
  pod 'FBSDKGamingServicesKit', '~> 17.0.0'
  pod 'FBSDKLoginKit', '~> 17.0.0'
  pod 'FBSDKShareKit', '~> 17.0.0'
  pod 'Firebase/Analytics', '10.22.0'
  pod 'Firebase/Core', '10.22.0'
  pod 'Firebase/Crashlytics', '10.22.0'
  pod 'Google-Mobile-Ads-SDK', '11.3.0'
  pod 'OneSignalXCFramework', '3.12.9'
end
target 'Unity-iPhone' do
  pod 'OneSignalXCFramework', '3.12.9'
end
use_frameworks!
target 'OneSignalNotificationServiceExtension' do
  pod 'OneSignalXCFramework', '3.12.9'
end
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES"] = "$(inherited)"
config.build_settings["LD_RUNPATH_SEARCH_PATHS"] = "$(inherited)"
end
end
end
end
Vitalchek commented 5 months ago

I faced a similar problem. I'll wait for an answer in this chat.

N4TUR1NO commented 5 months ago

+1

eduribeiro-fanatee commented 5 months ago

Same issue here

Vladeng commented 5 months ago

+1

stzseungmokyun commented 5 months ago

I turned on the “Link Framework Statically” option in “ios resolver settings” and the problem was solved. image

stanislavsmagin commented 5 months ago

Have the same problem. But I can't use static linking. Waiting for an answer.

GreatSociety commented 5 months ago

Try add in post build script this code:

            var project = new PBXProject();
            project.ReadFromFile(projPath);
            string mainTargetGuid = project.GetUnityMainTargetGuid();
            project.AddBuildProperty(mainTargetGuid, "OTHER_LDFLAGS", "-ObjC");

Works for me

Some information about this flag: https://developer.apple.com/library/archive/qa/qa1490/_index.html

umair6 commented 4 months ago

+1

gagbaghdas commented 3 weeks ago

The same issue. Is there any updates on this?