Search Unity

iOS framework addition failed due to a CocoaPods installation failure

Discussion in 'Unity Build Automation' started by glaksmono, Dec 5, 2020.

  1. glaksmono

    glaksmono

    Joined:
    Nov 19, 2020
    Posts:
    21
    The following errors showed up from Unity Cloud log:

    Code (CSharp):
    1. 779: [Unity] ERROR: iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.
    2. 780: [Unity] ERROR: iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.
    Any ideas how I should resolve it?
     
    dan_ginovker likes this.
  2. BigGameCompany

    BigGameCompany

    Joined:
    Sep 29, 2016
    Posts:
    112
    Been having the exact same issue for days with a project that contains the Facebook SDK. Would love to hear some suggestions for fixes.

    Thanks
     
  3. BigGameCompany

    BigGameCompany

    Joined:
    Sep 29, 2016
    Posts:
    112
    I think I fixed this issue (still got other issues) by changing the iOS Resolver settings to add cocoapods to the xcode project instead of the workspace. Hope that helps
     
  4. glaksmono

    glaksmono

    Joined:
    Nov 19, 2020
    Posts:
    21
    Doesn't seem like it's working for me. What "other issue"? Is it related?
     
    Last edited: Dec 5, 2020
  5. BigGameCompany

    BigGameCompany

    Joined:
    Sep 29, 2016
    Posts:
    112
    I was still getting an error loading a swift core library so I added this script to the Editor folder.

    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEditor.Callbacks;
    3. using UnityEditor.iOS.Xcode;
    4. public class XCodePostProcess
    5. {
    6.     [PostProcessBuild]
    7.     public static void OnPostprocessBuild(BuildTarget target, string path)
    8.     {
    9.         if (target == BuildTarget.iOS)
    10.         {
    11.             string projPath = PBXProject.GetPBXProjectPath(path);
    12.             PBXProject proj = new PBXProject();
    13.             proj.ReadFromFile(projPath);
    14.             string targetGuid = proj.GetUnityMainTargetGuid();
    15.             foreach (var framework in new[] { targetGuid, proj.GetUnityFrameworkTargetGuid() })
    16.             {
    17.                 proj.SetBuildProperty(framework, "ENABLE_BITCODE", "NO");
    18.                 proj.SetBuildProperty(framework, "EMBEDDED_CONTENT_CONTAINS_SWIFT", "YES");
    19.                 proj.SetBuildProperty(framework, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES");
    20.                 proj.SetBuildProperty(framework, "SWIFT_VERSION", "5.0");
    21.             }
    22.  
    23.             proj.WriteToFile(projPath);
    24.         }
    25.        
    26.     }
    27.    
    Are you still getting the same error after changing the iOS resolver settings, or something else?
     
  6. glaksmono

    glaksmono

    Joined:
    Nov 19, 2020
    Posts:
    21
    Yeah, iOS resolver settings doesn't help. I realized this is happening behind the scenes when I try to manually archived the XCode project:

    ➜ CrazyFlap_iOS git:(ios_build) pod update
    Update all pods
    Updating local specs repositories
    Analyzing dependencies
    [!] CocoaPods could not find compatible versions for pod "Google-Mobile-Ads-SDK":
    In Podfile:
    Google-Mobile-Ads-SDK (~> 7.68)
    IronSourceAdMobAdapter (= 4.3.17.2) was resolved to 4.3.17.2, which depends on
    Google-Mobile-Ads-SDK (= 7.66.0)
    Specs satisfying the `Google-Mobile-Ads-SDK (~> 7.68), Google-Mobile-Ads-SDK (= 7.66.0)` dependency were found, but they required a higher minimum deployment target.

    ➜ CrazyFlap_iOS git:(ios_build) cat Podfile
    source 'https://github.com/CocoaPods/Specs.git'
    source 'https://github.com/CocoaPods/Specs'
    platform :ios, '11.0'
    target 'UnityFramework' do
    pod 'Firebase/Auth', '7.0.0'
    pod 'Firebase/Core', '7.0.0'
    pod 'Firebase/Database', '7.0.0'
    pod 'Google-Mobile-Ads-SDK', '~> 7.68'
    pod 'IronSourceAdMobAdapter', '4.3.17.2'
    pod 'IronSourceSDK', '7.0.4.0'
    end

    Something isn't working with IronSource SDK
     
  7. tarmo-jussila

    tarmo-jussila

    Joined:
    Jun 4, 2015
    Posts:
    42
    Did you manage to solve this issue?
     
  8. SReplyR

    SReplyR

    Joined:
    Jan 4, 2019
    Posts:
    12
    I know it´s necroposting, but i´m facing the same issue with Firestore in combination with Ar Core Extensions on Unity 2020.2. My blind guess is that it has nothing strictly to do with the service used, but with a general issue triggered by something.

    I get a long error like glaksmono up here, but one line differs:


    "CocoaPods could not find compatible versions for pod "nanopb":
    In Podfile:
    ARCore/CloudAnchors (~> 1.24.0) was resolved to 1.24.0, which depends on
    nanopb (~> 2.30906.0)"

    I updated pods manually, uninstalled and reinstalled it, it seems there´s no way to get through this.
     
  9. rajivrao

    rajivrao

    Unity Technologies

    Joined:
    Feb 19, 2019
    Posts:
    111
    Hey folks, sorry for the delay on responding to this. I think honestly your best bet is filing a support ticket for an issue like this. The dev team can take a closer look at your scenarios (especially since it's a CocoaPods issue) and help you get to the bottom of it.
     
  10. SReplyR

    SReplyR

    Joined:
    Jan 4, 2019
    Posts:
    12
    Thanks, i found out in the mean time.
    I was using Firestore and Ar Core Extensions, which both rely on the same pod "nanopb", but they require 2 different versions of this pod to run, and it´s naturally not possible to include both. The optimal scenario would be an update on Ar Core Extensions side, which is the one literally stuck on updates.

    I tried anyways to hack this, looking through configuration files to possibly change one of the 2 requirements and give it a shot, but i kinda failed or probably it´s a value specified somewhere else in some dll, and so inaccessible.
     
  11. UnityBuilder

    UnityBuilder

    Joined:
    Apr 19, 2013
    Posts:
    7
    This is due to some issues that happen when Unity checks the pod version installed and it thinks it has the correct pods installed. Dependency manager & iOS resolver will not correctly identify the pods needed to properly build a workspace for iOS

    THE FIX-
    You can select the folder that the pod file resides in and open a new terminal at that location. Run a pod update.

    If that does not work open the pod file that was generated and modify it to match the version of Firebase. (8.7.0 is current at time of this post.)
    Then Run pod update in terminal and it should install all of the items you need and generate the workspace.

    THE Additional FIX-

    If that does not work also note that in the 8.7.0 unity package it does not recognize files that have already been imported from the other firebase packages you used so it will add a mess of multiple same files.

    Most just go through and remove until the errors are gone but if after doing so and each file does not reside in the proper location then it will never initialize correctly and even though it will work in the editor when you go to a live build it will crash on startup.

    If that happens to you I suggest you use the previous Firebase Unity package (6.16.0 at the time of this post)
    This package will not create duplicates as you import the packages you want to use in the project.

    You may still need to update the pod file and run a pod update after doing this but at least you will have a working build that initializes correctly and runs properly when you send it to the app store.

    Hope this post will be helpful to anyone having issues with this. I'll post an article about this issue in more detail on the Unity Live Help Experts.

    If additional help is needed after trying this or you are still experiencing issues you can contact me on the help platform here
    https://livehelp.unity.com/booking/UnityBuilder