Search Unity

Unity not generating Podfile

Discussion in 'iOS and tvOS' started by Hardcore_Graverobber, Mar 5, 2021.

  1. Hardcore_Graverobber

    Hardcore_Graverobber

    Joined:
    Jul 31, 2016
    Posts:
    9
    Hi,

    when I build the iOS version of my game it creates the project folder.
    However there is no Podfile and I'm facing an error saying:
    GoogleMobileAds.h file not found. There is also no xcworkspace file.

    I guess it is because the dependency were not installed which is because there is no podfile to run.
    If I open External Dependency Resolver -> iOS Resolver and click on Install CocoaPods it shows me
    "CocoaPods installation detected /usr/local/bin/pod" so I assume cocoa pods is well installed.

    Why is Unity not generating the pod file and what do I have to do in order for it to be generated?
    Thank you!

    Best regards
     
  2. Petras-Unity

    Petras-Unity

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    25
    After building iOS project you have to create pod file in project directory yourself and then do pod install for a project (this means installing pod packages to project, not installing CocoaPods itself):
    1. Open Terminal
    2. Navigate to your project's directory
    3. Create Podfile manually or do it by executing
      pod init
      command
    4. Fill in Podfile with desired packages
    5. Execute
      pod install
      to install packages listed inside pod file
    6. In XCode open newly generated .xcworkspace project file
    More information about pods usage can be found in official guide: Using CocoaPods
     
  3. Hardcore_Graverobber

    Hardcore_Graverobber

    Joined:
    Jul 31, 2016
    Posts:
    9
    Thanks for the answer.
    If this is the case then why can I select options for Pod generation and if a workspace or xcodeproj file should be generated under External Services -> iOS -> Settings. What is the point?
    Also, how am I supposed to know what dependencies certain assets/libraries etc need.
    I'm facing the issue in regards of GoogleMobileAds.h from a project that integrates Unity Ads on iOS.... I would never have thought that I need to add Google SDKs for advertising on iOS.

    P.S.
    However with the manual installation via pod install my issue is not fixed. It still shows me GoogleMobileAds.h not found, even though I changed my Podfile to add pod 'Google-Mobile-Ads-SDK' and the frameworks are well shown in XCode.
     
  4. Hardcore_Graverobber

    Hardcore_Graverobber

    Joined:
    Jul 31, 2016
    Posts:
    9
    I managed to solve the issue by myself.
    Just putting the information here for future references or if others encounter similar issues.

    My issue was that the UnityAds package https://developers.google.com/admob/unity/quick-start or https://github.com/googleads/googleads-mobile-unity/releases/ apparently was not correctly imported or perhaps stuff was cleaned out by accident before.
    However after re-importing the package and setting the External Services -> iOS -> Settings back to default, everything generates just fine. There is a pod file and even a workspace file as well.

    So, the POD file does NOT need to be generated manually. It is generated by Unity as it should be.
     
  5. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    388
    I ran into the same issue (Podfile not generated) when updating a project from 2019 to 2021. Where exactly do I find this "External Services" setting?
     
  6. Yves35

    Yves35

    Joined:
    Feb 23, 2018
    Posts:
    5
    Same issue with Unity 22.3.11f1 - Ads 4.4.1 - Medation 1.0.4
    None of the solutions above work.
    Should we give up using Mediation on iOS?
     
  7. Gingerbeer

    Gingerbeer

    Joined:
    Aug 10, 2015
    Posts:
    24
    I have exactly the same issue.
     
  8. TanveerSabir

    TanveerSabir

    Joined:
    Jun 10, 2015
    Posts:
    1

    Try this video tutorial:
     
    Gingerbeer likes this.
  9. Gingerbeer

    Gingerbeer

    Joined:
    Aug 10, 2015
    Posts:
    24
    It doesn't work for me, but thank you for posting it.
     
  10. tomiwkd14

    tomiwkd14

    Joined:
    Jan 31, 2022
    Posts:
    2
    Im on the same boat, did u manage to solve it?
     
  11. AlexSchtelbe

    AlexSchtelbe

    Joined:
    Apr 18, 2021
    Posts:
    2
    same problem here