Hello, after updating Unity Ads Legacy to v4.12.0 and exporting to iOS Xcode 16 I get this error in xcode:
UnityAdsShowListener UnityAds/UnityAds.h file not found.
I’m using only Unity Ads.
My Unity version is 2022.3.47f1
Edit: I have tried the latest version 2022.3.49f1 and the same result.
I have downgraded to Unity Ads Legacy 4.4.2 and now it works.
The problem is that the newest Unity Ads Legacy SDK does not include the UnityAds.framework in xcode and I can’t include it manually.
Downgrade is fixed my problem, but I think there will be a problem during the live release because I’m not using the latest version. Thanks for posting this.
Ok in package manager I upgraded from Advertisements Legacy from 4.4.2 to 4.12.0 (to support the Apple Privacy Manifest update orelse Apple rejects your build)… Unity then tries to install cocoapods… and in my case fails.
Open a terminal and type ‘pod’ - if its installed then great, in my case in Unity I got an error saying it couldn’t install cocoapods for the current user.
I then went down some rabbit hole learning about cocoapods and trying to get cocoapods setup correctly… some posts say use bash, some say zsh, run install, gem install, sudo install, install to the user directory… blah blah… I ended up in a situation where cocoapods was installed, but couldn’t run as one of its dependencies was throwing an error…
so I then uninstalled cocoapods completely:
sudo gem uninstall cocoapods -n /usr/local/bin
sudo gem uninstall cocoapods
then used brew to install cocoapods (this also installs its dependencies):
brew install cocoapods
at the end of the install it asks you if you want to link, you need to run the 3 commands that it gives you.
Then do a clean build of the unity project and hopefully its builds fine.
In the built Xcode project open the file with the .xcworkspace extension, this will open Xcode, with the pods, and the iPhone project should now find UnityAds/UnityAds.h and build.
In file included from Libraries\com.unity.ads\Plugins\iOS\UnityAdsLoadListener.mm:1:
Libraries\com.unity.ads\Plugins\iOS/UnityAdsLoadListener.h(1,9): fatal error: 'UnityAds/UnityAds.h' file not found
Did you ever find a resolution for this? I need 4.12.0 for ad targeting.
Look for the value for INSTALLATION DIRECTORY (it will probably look something like /usr/local/lib/ruby/gems/3.4.0/ or a similar Homebrew path).
Next, look for the value for EXECUTABLE DIRECTORY. This is the path you need to run pod and might look something like this: /usr/local/lib/ruby/gems/3.4.0/bin (or a path under ~/.gem/ruby/3.4.0/bin).
ruby -v
Based on what version of ruby you have installed, type the following command (replace 3.4.0 with your version)
echo 'export PATH="/usr/local/lib/ruby/gems/3.4.0/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
which pod
cd /Users/macbook/Desktop/thegame (replace this with your unity exported folder)
pod install
Wait for it to install dependencies..
Now open the project .xcworkspace in xcode.
This is the setup you need to install homebrew, you will make this only once and from now on , on each project you just need to open terminal and use cd command and pod install.
This worked on my Intel based macbook.