Search Unity

Question Facebook SDK fails due to CS0619 errors

Discussion in 'Unity Build Automation' started by Multiscription_Uffe, Sep 29, 2022.

  1. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    18
    Hi all,


    I'm working on getting the Facebook Unity SDK into a Unity project. It builds perfectly on my local computer, both for iOS and Android. However, when building the projects on Unity Cloud Builds it fails (both for iOS and Android), and it seems like it's due to the following error:

    7804: [2022-09-29T11:47:58Z - Unity] Assets/FacebookSDK/Examples/Scripts/ConsoleBase.cs(243,42): error CS0619: 'ScreenOrientation.Landscape' is obsolete: 'Use LandscapeLeft instead (UnityUpgradable) -> LandscapeLeft'

    Also, Unity's own ad library seem to trigger the same error:

    6101: [2022-09-29T11:47:37Z - Unity] Library/PackageCache/com.unity.ads@4.2.1/Runtime/Advertisement/Platform/Editor/Placeholder.cs(83,47): error CS0619: 'ScreenOrientation.Landscape' is obsolete: 'Use LandscapeLeft instead (UnityUpgradable) -> LandscapeLeft'

    These errors are marked in red, so it indeed seems like these are the reason why it fails. However, while the code is obsolete, this should ONLY be a warning, and allow Unity Cloud Build to continue.

    Anyone knows how to fix this?

    Thank you VERY much in advance for your help!


    Kind regards,
    Uffe Flarup
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Maybe related to https://issuetracker.unity3d.com/is...urns-landscape-despite-it-being-made-obsolete
     
  3. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    18
    Hi @JeffDUnity3D

    Thanks for your help on this. I can see that something was fixed in 2022.2.x, but it hasn't been backported yet. Also, I can fix the issue in the Facebook SDK, but I still get an error from the Unity ads SDK:

    15: [2022-10-03T12:44:29Z - Unity] Library/PackageCache/com.unity.ads@4.2.1/Runtime/Advertisement/Platform/Editor/Placeholder.cs(83,47): error CS0619: 'ScreenOrientation.Landscape' is obsolete: 'Use LandscapeLeft instead (UnityUpgradable) -> LandscapeLeft'

    Any suggestion to how I get around a package from Unity that doesn't build? There are no further updates to that package.

    Thank you very much for your help!

    Kind regards,
    Uffe
     
  4. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    18
    After updating to version 4.4.1 of the Unity Ads package I know have made some progress getting Facebook SDK to build using Unity Cloud Build. It builds perfectly fine LOCALLY, but on UCB it still fails, now with the error pasted below.

    Any suggestions to why this fails on UCB, but works locally?

    Thank you very much in advance.

    Kind regards,
    Uffe Flarup


    Code (CSharp):
    1. Undefined symbols for architecture arm64:
    2.   "_OBJC_CLASS_$_GADServerSideVerificationOptions", referenced from:
    3.       objc-class-ref in unity-plugin-library.a(GADUInterface.o)
    4.   "_GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth", referenced from:
    5.       +[GADUPluginUtil adaptiveAdSizeForWidth:eek:rientation:] in unity-plugin-library.a(GADUPluginUtil.o)
    6.   "_GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth", referenced from:
    7.       +[GADUPluginUtil adaptiveAdSizeForWidth:eek:rientation:] in unity-plugin-library.a(GADUPluginUtil.o)
    8.   "_GADAdSizeEqualToSize", referenced from:
    9.       +[GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a(GADUPluginUtil.o)
    10.   "_GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth", referenced from:
    11.       +[GADUPluginUtil adaptiveAdSizeForWidth:eek:rientation:] in unity-plugin-library.a(GADUPluginUtil.o)
    12.   "_CGSizeFromGADAdSize", referenced from:
    13.       +[GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a(GADUPluginUtil.o)
    14.   "_kGADAdSizeSmartBannerLandscape", referenced from:
    15.       -[GADUBanner initWithSmartBannerSizeAndBannerClientReference:adUnitID:adPosition:] in unity-plugin-library.a(GADUBanner.o)
    16.       -[GADUBanner initWithSmartBannerSizeAndBannerClientReference:adUnitID:customAdPosition:] in unity-plugin-library.a(GADUBanner.o)
    17.       +[GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a(GADUPluginUtil.o)
    18.   "_GADAdSizeFromCGSize", referenced from:
    19.       +[GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a(GADUPluginUtil.o)
    20.       +[GADUPluginUtil adSizeForWidth:height:] in unity-plugin-library.a(GADUPluginUtil.o)
    21.   "_kGADAdSizeSmartBannerPortrait", referenced from:
    22.       -[GADUBanner initWithSmartBannerSizeAndBannerClientReference:adUnitID:adPosition:] in unity-plugin-library.a(GADUBanner.o)
    23.       -[GADUBanner initWithSmartBannerSizeAndBannerClientReference:adUnitID:customAdPosition:] in unity-plugin-library.a(GADUBanner.o)
    24.   "_OBJC_CLASS_$_GADRewardedAd", referenced from:
    25.       objc-class-ref in unity-plugin-library.a(GADURewardedAd.o)
    26.      (maybe you meant: _OBJC_CLASS_$_GADRewardedAdBridgeV8, _OBJC_CLASS_$_GADRewardedAdBridge )
    27.   "_OBJC_CLASS_$_GADRequest", referenced from:
    28.       objc-class-ref in unity-plugin-library.a(GADURequest.o)
    29.      (maybe you meant: _OBJC_CLASS_$_GADRequestBridge)
    30.   "_OBJC_CLASS_$_GADBannerView", referenced from:
    31.       objc-class-ref in unity-plugin-library.a(GADUBanner.o)
    32.   "_OBJC_CLASS_$_GADInterstitialAd", referenced from:
    33.       objc-class-ref in unity-plugin-library.a(GADUInterstitial.o)
    34.      (maybe you meant: _OBJC_CLASS_$_GADInterstitialAdBridgeV8)
    35.   "_GADErrorUserInfoKeyResponseInfo", referenced from:
    36.       _GADUGetAdErrorResponseInfo in unity-plugin-library.a(GADUInterface.o)
    37.   "_OBJC_CLASS_$_GADExtras", referenced from:
    38.       objc-class-ref in unity-plugin-library.a(GADURequest.o)
    39.   "_GADAdSizeFullWidthPortraitWithHeight", referenced from:
    40.       +[GADUPluginUtil adSizeForWidth:height:] in unity-plugin-library.a(GADUPluginUtil.o)
    41.   "_OBJC_CLASS_$_GADRewardedInterstitialAd", referenced from:
    42.       objc-class-ref in unity-plugin-library.a(GADURewardedInterstitialAd.o)
    43.   "_OBJC_CLASS_$_GADMobileAds", referenced from:
    44.       objc-class-ref in unity-plugin-library.a(GADUInterface.o)
    45.      (maybe you meant: _OBJC_CLASS_$_GADMobileAdsBridge)
    46.   "_OBJC_CLASS_$_GADAppOpenAd", referenced from:
    47.       objc-class-ref in unity-plugin-library.a(GADUAppOpenAd.o)
    48. ld: symbol(s) not found for architecture arm64
     
  5. Barb-Unity

    Barb-Unity

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    50
    Hi!

    What versions of Unity and Xcode are you using locally? Does the Xcode project build successfully as well? I checked your logs and there are quite a few errors that lead me to believe that this is an issue with Xcode, so it would be great if you could provide more information.

    Cheers!
     
  6. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    18
    Hello @Barb-UnityAds

    Thank you very much for helping looking into this! The project builds fine (and runs fine on device as well) when building on my local computer. I'm using Unity 2020.3.40f1 and XCode 14.0.1 (14A400).

    Kind regards
    Uffe
     
  7. Barb-Unity

    Barb-Unity

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    50
    Hi Uffe,

    I see that you're using Unity 2020.3.41f1 and XCode 14.0.0 for your build target configurations, so the issue might be the mismatched versions. First of all, I'd advise using Unity 2020.3.40f1 in UCB. As for XCode - sadly, 14.0.1 is not available in Cloud Build yet, but we're expecting it to be released very soon. Could you please try building locally using XCode 14.0.0 and check if it succeeds?

    Cheers!
     
  8. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    18
    Hi @Barb-UnityAds I just tried with XCode 14.0 (14A309) on my local computer, and it works fine here.
     
  9. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    18
    Hi again @Barb-UnityAds I have tried with different XCode configuration on UCB, but still no luck getting the Facebook SDK to build together with my game. On my local computer I have also just tested using XCode 14.1, and that works fine.

    Do you have any suggestions to why Facebook SDK doesn't build on UCB?
     
  10. Barb-Unity

    Barb-Unity

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    50
    Hi Uffe,

    I see that your builds on UCB are still getting the same error: "xcode build failed". Could you please confirm if you've tried building locally after making a fresh clone of your repository into a clean local folder that is not your usual working folder? If not, could you please doing that as well?
     
  11. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    18
    Hi again @Barb-UnityAds

    I just did a completely clean git clone, followed by importing into Unity from scratch, and building everything from scratch. And it still worked locally.

    After inspecting the latest logs from UCB, it's still the following lines that gets my attention:


    18337: <span class="log_warning_line">[2022-11-02T14:00:48.114Z] - 7.1.1.2.4.2 - INFO: &#9656; <span class="log_warning">&#9888</span>;️ ld: arm64 function not 4-byte aligned: _unwind_tester from /BUILD_PATH/multiscription-aps.draw-pass.ios-2020-facebook/temp20221102-5904-1xhiiqg/Libraries/libiPhone-lib.a(unwind_test_arm64.o)</span>
    18338:
    18339: <span class="log_error_line">[2022-11-02T14:00:49.816Z] - 7.1.1.2.4.2 - INFO: &#9656; <span class="log_error">&#10060</span>; ld: symbol(s) not found for architecture arm64</span>
    18340:
    18341: <span class="log_error_line">[2022-11-02T14:00:49.825Z] - 7.1.1.2.4.2 - INFO: &#9656; <span class="log_error">&#10060</span>; clang: error: linker command failed with exit code 1 (use -v to see invocation)</span>


    I did notice the following forum post : https://answers.unity.com/questions/1805667/arm64-function-not-4-byte-aligned-unwind-tester-fr.html

    He has the same build error, and he's building on virtual machines. Is that maybe the reason why?
     
  12. Barb-Unity

    Barb-Unity

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    50
    Hi @Multiscription ,

    I see that all of your recent builds have been successful. Are you still experiencing this issue?
     
  13. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    18
  14. Barb-Unity

    Barb-Unity

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    50
    Hi @Multiscription

    What version of Cocoapods are you using locally? I see that the failed build that you linked was using Xcode 13.2.1, which could be the issue. Could you please try setting Xcode to a higher version on UCB and try building again? If the build still fails, please contact us at cloudbuildsupport@unity3.com and we will investigate this further.

    Cheers!
     
  15. Multiscription_Uffe

    Multiscription_Uffe

    Joined:
    May 2, 2022
    Posts:
    18
    Hi @Barb-UnityAds

    Just tried switching to XCode 14.1 on UCB, but still the same result (and we're using Cocoapods 1.11.3 btw). The email you mention is no longer active. Which email would you like me to reach out to instead?

    Thanks a lot in advance.

    Uffe
     
  16. Barb-Unity

    Barb-Unity

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    50
    Hi Uffe,

    Thank you for your response.

    I'm so sorry, I made a mistake when writing the email! Please contact us at cloudbuildsupport@unity3d.com. Again, sorry for the confusion caused here.

    Cheers!
     
    Multiscription_Uffe likes this.