'UnityMediationSdk/UnityMediationSdk.h' file not found

I installed Mediation via the “tarball method”. I downloaded the .tgz and it now lives in my project in the Assets/Plugins/Mediation folder I have made. Pleasde see below:

I’ve added it via the package manager and it’s all working perfectly in Editor. The problem is when I build it I get errors and also the cloud build is broken. It says ‘UnityMediationSdk/UnityMediationSdk.h’ file not found

8152028--1059032--upload_2022-5-24_11-13-43.png

This also seems to mean that Cloud Build is broken too and seems to have different errors but I am guessing they are linked…

Since moving to package manager manifest I seem to be getting these erros… Not sur eif better or worse

8152106--1059068--upload_2022-5-24_11-58-51.png

Hello @danny_unity544 ,

This seems to be an issue you are facing with iOS only, correct? Can you first confirm you are opening the xcworkspace file, and not the xcodeproj file? Here’s more information from the troubleshooting manual.

Thank you for sharing this issue with us, let us know if this resolves your issue.

1 Like

It seems to be working when I switched off Admob in the mediations. Is this not working for some reason?

Hey @DeclanMcPartlin .

Same problem here. Can’t get the .workspace because it’s failing to build and I’m getting this:

iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.
After the failure, "pod repo update" was executed and succeeded. "pod install" was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: https://guides.cocoapods.org/using/troubleshooting.html for potential solutions.
pod install output:
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "FBSDKCoreKit_Basics":
  In Podfile:
    UnityMediationFacebookAdapter (~> 0.4.0) was resolved to 0.4.0, which depends on
      FBAudienceNetwork (< 6.9, >= 6.3) was resolved to 6.8.0, which depends on
        FBSDKCoreKit_Basics
    UnityMediationFacebookAdapter (~> 0.4.0) was resolved to 0.4.0, which depends on
      FBSDKCoreKit_Basics (~> 11.0)
CocoaPods could not find compatible versions for pod "GoogleAppMeasurement":
  In Podfile:
    Firebase/Core (= 9.0.0) was resolved to 9.0.0, which depends on
      FirebaseAnalytics (~> 9.0.0) was resolved to 9.0.0, which depends on
        FirebaseAnalytics/AdIdSupport (= 9.0.0) was resolved to 9.0.0, which depends on
          GoogleAppMeasurement (= 9.0.0)
    UnityMediationAdmobAdapter (~> 0.4.0) was resolved to 0.4.0, which depends on
      Google-Mobile-Ads-SDK (~> 8.2) was resolved to 8.4.0, which depends on
        GoogleAppMeasurement (~> 7.0)
CocoaPods could not find compatible versions for pod "nanopb":
  In Podfile:
    Firebase/Crashlytics (= 9.0.0) was resolved to 9.0.0, which depends on
      FirebaseCrashlytics (~> 9.0.0) was resolved to 9.0.0, which depends on
        GoogleDataTransport (~> 9.1) was resolved to 9.1.4, which depends on
          nanopb (< 2.30910.0, >= 2.30908.0)
    Firebase/Crashlytics (= 9.0.0) was resolved to 9.0.0, which depends on
      FirebaseCrashlytics (~> 9.0.0) was resolved to 9.0.0, which depends on
        nanopb (~> 2.30908.0)

Mediation 0.4.1-preview.1, Unity 2021.3.3f1, macOS Monterey 12.4

Hello @pablo_leban and @danny_unity544 ,

Could you share your Podfile contents from the generated Xcode project and EDM4U (External Dependency Manager 4 Unity, also known as Play Services Resolver) versions to confirm what is going on? It is currently looking like there are some version conflicts.

Thanks!

Sure. This is what my Podfile looks like.

source 'https://cdn.cocoapods.org/'
platform :ios, '12.0'
target 'UnityFramework' do
  pod 'Firebase/Auth', '9.0.0'
  pod 'Firebase/Core', '9.0.0'
  pod 'Firebase/Crashlytics', '9.0.0'
  pod 'Firebase/Storage', '9.0.0'
  pod 'Protobuf'
  pod 'UnityMediationAdmobAdapter', '~> 0.4.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
  pod 'UnityMediationAppLovinAdapter', '~> 0.4.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
  pod 'UnityMediationFacebookAdapter', '~> 0.4.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
  pod 'UnityMediationSdk', '~> 0.4.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
  pod 'UnityMediationUnityAdapter', '~> 0.4.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
end

I’m using the latest version of EDM4U (1.2.171)

Thank you!

Hey @pablo_leban ,

Thank you for sharing this file, I can reproduce your situation. The reason for this is that the dependencies of Firebase conflict with the dependencies in Unity Mediation, due to the version restraint of the Admob SDK.

A short term solution would be to keep Firebase locked to the 8.X versions (~> 8.0), these are still compatible with the currently supported Unity Mediation Admob versions. We are planning on releasing a new Admob adapter soon also, that will be compatible with the latest Firebase dependencies - we will keep you posted here in this thread regarding that.

Thank you again for sharing this issue with us, we will prioritize the new Admob adapter due to this.

Thanks for replying! I’m gonna wait for the fix from your side then as I need Firebase 9.0.0 because of a fix implemented in that version: https://github.com/firebase/firebase-unity-sdk/issues/133#issuecomment-1132289297

Note that there’s also a compatibility issue with Facebook’s SDK:

- [!] CocoaPods could not find compatible versions for pod "FBSDKCoreKit_Basics":

Not sure if you have to update the Meta adapter as well.

Thank you anyway!

Hey @pablo_leban ,

Thanks for pointing that out, after some testing, I noticed that once the Google dependencies were able to resolve, the other conflicts did not show up anymore either. I believe this is an erroneous error message coming from Cocoapods. Notice how for both FBSDKCoreKit_Basics and nanopb the versions actually do not clash, whereas GoogleAppMeasurement does.

That being said, we will still update Facebook’s SDK very soon as well.

Thank you again for sharing!

Hey @pablo_leban ,

The latest Unity Mediation package has been released (0.5.0), and with it, the iOS dependency versions have been increased to the latest versions. Feel free to update and let us know if you’re still facing any native dependency conflicts. Thanks again for your patience!

1 Like

Last weeks, I had problems as it showed above, and I once resolved it with pos install dance and some other steps. However, about two weeks ago, the problems came up in a strict way, my archive build failed but iPhone was ok, and in a few days the build became failed too. There were no Firebase dependencies, but the description was the same.

I postponed the project for a few weeks, and I back to it when 0.5.0 version appeared. I updated EDM4U to the last one (there was some problems nearby 169), next I cleaned up the project locally (kind of “git clone” and build from scratch), and the problems were resolved - run on iPhone, and archive works without any issues and additional steps.

So, if someone has similar problems, I think it worth to update to the last one and clean up caches.

Thank you for your work and the quick update!

1 Like

Hi @DeclanMcPartlin
I have the same problem
Unity 2021.3.2 Unity.Mediation 0.5-pre5

INFO:root:xcodebuild: /Users/pepi/GoCD_Agent/******.xewq.intermediate/1_UnityOut/Libraries/com.unity.services.mediation/Runtime/Plugins/iOS/UMSPUnityMediation.mm:1:9: fatal error: ‘UnityMediationSdk/UnityMediationSdk.h’ file not found

INFO:root:xcodebuild: #import <UnityMediationSdk/UnityMediationSdk.h>
INFO:root:xcodebuild: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INFO:root:xcodebuild: 1 error generated.
INFO:root:xcodebuild:
INFO:root:xcodebuild: ** ARCHIVE FAILED **
INFO:root:xcodebuild:
INFO:root:xcodebuild:
INFO:root:xcodebuild: The following build commands failed:
INFO:root:xcodebuild: CompileC /Users/pepi/Library/Developer/Xcode/DerivedData/Unity-iPhone-fgcxlxiioqrfdrbjqtiywtpcmaox/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UMSPUnityMediation.o /Users/*****.xewq.intermediate/1_UnityOut/Libraries/com.unity.services.mediation/Runtime/Plugins/iOS/UMSPUnityMediation.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target ‘UnityFramework’ from project ‘Unity-iPhone’)

can you help me with it ?

I am having a similiar issue still. When I build for IOS it is not creating the workspace file for xCode, just the project file. In the Editor when I build I get “iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project”. I’ve tried fresh re-installs of Play Services Resolver, Unity Mediation, and cocoapods but no improvements yet.

I am having a similiar issue still with Medition 0.5.0. When I build for IOS it is not creating the workspace file for xCode. but when I uninstall the meta adapter, it works!

I’m having the same issue using Unity 2020.3.36f1. I doesn’t build a workspace file for me to open with, so I’m stuck just opening the xcode project directly, and then the error pops up…mediation header not found. Any new ideas on this?

Same in Unity 2022.1.9f1 using Mediation 0.5.0 - preview 5 - no workspace file, no capability to build due to UnityMediationSdk.h missing

I solved the problem by getting rid of the Play Resolver that I got from either the Mediation package or maybe even the Purchasing package. Either way, delete that folder entirely from your project and get the one from GitHub.

Step Breakdown

  1. In your Unity project, delete the Play Resolver folder
  2. Go to https://github.com/googlesamples/unity-jar-resolver
  3. Click the green button, download the zip, unzip it.
  4. In Unity, go to Assets → Import Package → Custom Package.
  5. Select external-dependency-manager-latest.unitypackage

Having the Resolver from this GitHub source instead of the one that came from Unity directly fixed my problem. When I build for iOS on my Mac now, the xcworkspace file is created. Opening that, there’s no errors and everything works perfect.

1 Like

Hey all,

I wanted to share a quick troubleshooting guide regarding this specific error:
UMSPUnityMediation.mm:1:9: fatal error: 'UnityMediationSdk/UnityMediationSdk.h' file not found

Checklist:

  • First check that the xcworkspace file is being opened, not xcodeproj from your generated iOS project folder. With the default EDM4U settings, this will only open the xcode project of your app, not the cocoapods project, so this is important. (If you changed the default settings, I’ll assume you know what you’re doing).

  • If you cannot locate the xcworkspace file in your generated iOS project folder, something went wrong at the generation step. Open the Unity Editor and copy paste the full cocoapods error log from your console to help us debug further.

  • If you can locate the xcworkspace and you are still getting this error, provide the following details:

  • The Untiy Editor version

  • The Unity Mediation version

  • The EDM4U version

  • The contents of your Podfile and Podfile.lock (if applicable)

This should save all of us time as we troubleshoot such issues together. Thanks!

Hello @ExcaliburGames ,

Could you check the checklist in the post just above, and provide more details based on that?

Thanks!