Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question UnityAds/UnityAds.h not found

Discussion in 'Unity Ads & User Acquisition' started by karthikveeramani, May 30, 2022.

  1. karthikveeramani

    karthikveeramani

    Joined:
    Jan 22, 2017
    Posts:
    7
    I setup admob mediation in my game, installed Unity and InMobi adapter + sdks per documentation on Google site. I downloaded the latest of everything and didn't go through Asset Store. I could build for iOS. But when I try to run it through Xcode, I get an error in GADUMUnityAdsInterface.m - 'UnityAds/UnityAds.h not found'. I was originally using 2019 version, which I upgraded to the latest 2021 release to check if that solves the problem, but it did not help - I still see it. I searched a lot, and while I see people complaining about this, there is no concrete solution that seemed to have worked. Could you please help?
     
    enhawk likes this.
  2. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hello @karthikveeramani ,
    To help us understand your issue could you clarify a few points?
    When you say inmobi + sdks per documentation, could you link to said documentation?
    Do you have a full build log we could look at?
     
  3. karthikveeramani

    karthikveeramani

    Joined:
    Jan 22, 2017
    Posts:
    7
    Forget the inmobi part, I don't think it is relevant, I mentioned it for completeness to explain that I am setting up admob mediation with Google ads + Unity ads + inmobi. The documentation I followed was https://developers.google.com/admob/unity/mediation/unity#step_3_import_the_unity_sdk_and_adapter.

    The log for that error is here:

    CompileC /Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/GADUMUnityAdsInterface.o /Users/kv/work/games/PawnGame/Build/iOS/Libraries/Plugins/iOS/GADUMUnityAdsInterface.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'UnityFramework' from project 'Unity-iPhone')

    cd /Users/kv/work/games/PawnGame/Build/iOS

    export LANG\=en_US.US-ASCII

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target arm64-apple-ios11.0 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -std\=c11 -fobjc-arc -fmodules -gmodules -fmodules-cache-path\=/Users/kv/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/kv/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -fmodule-name\=UnityFramework -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wdeprecated-implementations -DCOCOAPODS\=1 -DPB_FIELD_32BIT\=1 -DPB_NO_PACKED_STRUCTS\=1 -DPB_ENABLE_MALLOC\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk -fno-objc-exceptions -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -fvisibility\=hidden -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wno-strict-prototypes -Wno-semicolon-before-method-body -fembed-bitcode-marker -iquote /Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/UnityFramework-generated-files.hmap -I/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/UnityFramework-own-target-headers.hmap -I/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/UnityFramework-all-non-framework-target-headers.hmap -ivfsoverlay /Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/all-product-headers.yaml -iquote /Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/UnityFramework-project-headers.hmap -I/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/include -I/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/GoogleUtilities/GoogleUtilities.framework/Headers -I/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/PromisesObjC/FBLPromises.framework/Headers -I/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/nanopb/nanopb.framework/Headers -I/Users/kv/work/games/PawnGame/Build/iOS/Classes -I/Users/kv/work/games/PawnGame/Build/iOS -I/Users/kv/work/games/PawnGame/Build/iOS/Classes/Native -I/Users/kv/work/games/PawnGame/Build/iOS/Libraries/bdwgc/include -I/Users/kv/work/games/PawnGame/Build/iOS/Libraries/libil2cpp/include -I/Users/kv/work/games/PawnGame/Build/iOS/Libraries/libil2cpp/include/pch -I/Users/kv/work/games/PawnGame/Build/iOS/Libraries/external/baselib/Include -I/Users/kv/work/games/PawnGame/Build/iOS/Libraries/external/baselib/Platforms/IOS/Include -I/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/DerivedSources-normal/arm64 -I/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/DerivedSources/arm64 -I/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/DerivedSources -Wno-missing-declarations -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/GoogleUtilities -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/PromisesObjC -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/nanopb -F/Users/kv/work/games/PawnGame/Build/iOS/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current -F/Users/kv/work/games/PawnGame/Build/iOS/Pods/GoogleAppMeasurement/Frameworks -F/Users/kv/work/games/PawnGame/Build/iOS/Pods/GoogleMobileAdsMediationInMobi/InMobiAdapter-10.0.5.0 -F/Users/kv/work/games/PawnGame/Build/iOS/Pods/GoogleMobileAdsMediationUnity/UnityAdapter-4.1.0.0 -F/Users/kv/work/games/PawnGame/Build/iOS/Pods/GoogleUserMessagingPlatform/Frameworks/Release -F/Users/kv/work/games/PawnGame/Build/iOS/Pods/InMobiSDK -F/Users/kv/work/games/PawnGame/Build/iOS/Pods/UnityAds -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/Google-Mobile-Ads-SDK -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/GoogleAppMeasurement/AdIdSupport -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/GoogleAppMeasurement/WithoutAdIdSupport -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/GoogleMobileAdsMediationInMobi -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/GoogleMobileAdsMediationUnity -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/GoogleUserMessagingPlatform -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/InMobiSDK/Core -F/Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/UnityAds -fno-strict-overflow -DNET_4_0 -DRUNTIME_IL2CPP\=1 -DBASELIB_INLINE_NAMESPACE\=il2cpp_baselib -DUNITY_VERSION_VER\=2021 -DUNITY_VERSION_MAJ\=3 -DUNITY_VERSION_MIN\=3 -include /Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/PrecompiledHeaders/SharedPrecompiledHeaders/15072610247191576641/Prefix.pch -MMD -MT dependencies -MF /Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/GADUMUnityAdsInterface.d --serialize-diagnostics /Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/GADUMUnityAdsInterface.dia -c /Users/kv/work/games/PawnGame/Build/iOS/Libraries/Plugins/iOS/GADUMUnityAdsInterface.m -o /Users/kv/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzxcadcwlbahkgfjntvqzodqbcep/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/GADUMUnityAdsInterface.o



    /Users/kv/work/games/PawnGame/Build/iOS/Libraries/Plugins/iOS/GADUMUnityAdsInterface.m:15:9: fatal error: 'UnityAds/UnityAds.h' file not found

    #import <UnityAds/UnityAds.h>

    ^~~~~~~~~~~~~~~~~~~~~

    1 error generated.
     
  4. karthikveeramani

    karthikveeramani

    Joined:
    Jan 22, 2017
    Posts:
    7
  5. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    I got this problem with Ironsource, in Xcode and Unity 2019.

    Xcode would always report "UnityAds.h not found"

    Had to stop using Ironsource completely, although I think it's a problem with Unity ads cocoapods and unity 2019
     
  6. karthikveeramani

    karthikveeramani

    Joined:
    Jan 22, 2017
    Posts:
    7
    I wish I don't have to stop using Unity ads completely due to this issue. I really wish Unity devs would respond because it impacts the usage of their products too. I'm seeing so many references to this, but none of them have a good solution.

    @jcGrenier trying again ...
     
  7. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hi @karthikveeramani and @hawken,

    Thanks for reaching out. To clarify what seems to be happening, it looks as though the product you are both using is Admob Mediation and ironSource Mediation (Unity Mediation, which we maintain and work on). These are not products we work on directly.

    From my perspective, this sounds like a dependency resolution issue (Unity Ads is simply not present) and is something that Google and ironSource should fix. To get a fix for this issue, we recommend you reach out to Google and ironSource respectively. We've alerted a developer from the Unity Ads team in case there's anything we can do.

    In the meantime we recommend you test out another mediation solution for comparison. For example our Unity Mediation solution puts a lot of effort into making sure it is Unity Editor compatible along with a lot of support if required.

    Thanks!
     
  8. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Apologies for the delay,
    As @DeclanMcPartlin mentioned, we can't provide much help with third party Mediation solutions. Their implementation of unity ads may have some bugs, but it is extremely hard for us to comment without looking at the Mediation solution's source code.

    If you ever decide to try out Unity's mediation solution we will gladly assist you with any issues you have :)
     
  9. shawnh_unity

    shawnh_unity

    Unity Technologies

    Joined:
    Aug 2, 2019
    Posts:
    2
    After googling the error:

    Code (CSharp):
    1.  
    2. /Users/kv/work/games/PawnGame/Build/iOS/Libraries/Plugins/iOS/GADUMUnityAdsInterface.m:15:9: fatal error: 'UnityAds/UnityAds.h' file not found
    3.  
    4. #import <UnityAds/UnityAds.h>
    GADUMUnityAdsInterface is an Admob Unity Plugin class found here. This likely means that the google mobile ads unity plugin has a bug that causes unity ads to not get included. This is not something that unity can fix. Google needs to fix this. But there are possibly work arounds that can be done. If you can directly ensure that UnityAds gets included through cocoapods then it should be able to be found by that google class. To do this you would need to directly import UnityAds through cocoapods or through direct inclusion. I cannot guarantee that this will work but it might.

    Those of us at unity are sorry that we can't be more helpful with this issue but the issue lies in third party sdks that incorporate our sdks. We do not maintain these.
     
  10. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    thanks for the reply. When asked, predictably they said it’s an issue with Unity Ads… it seems to be a certain combination of Unity 2019, unity ads, cocoapods and Xcode.

    although it is worth noting that this issue is appearing in two different mediation solutions.

    This was a little while back for me. I had to find another solution.
     
    Last edited: Jun 3, 2022
  11. karthikveeramani

    karthikveeramani

    Joined:
    Jan 22, 2017
    Posts:
    7
    Thanks for the replies. This is what I was worried about, each one pointing to the other :( .. My experience getting support from Google has been much worse so I don't think it'll go far. I looked at unity mediation and if I got it right, you don't support banner ads which is a show stopper for me. If not (and if you at least have Google ads integration), I would not have minded the rewrite to use your solution just for the better support.
     
  12. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Unity Mediation is still in active development, and we keep improving and adding new features :) We hope to eventually be a good choice for you, but in the meantime unfortunately we are limited in the assistance we can offer. We face the same integration issues, generally due to dependency resolution, but we can only fix them for our mediation solution as we have no control over other organisations.
     
  13. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    To add to what JC said, we are actively making continuous improvements to Unity's monetization products to suit what developers need most. While we don't have banners available yet, please continue to check our technical documentation for accepted ad formats. Also, if you'd like to sign up for early access to features in development, you can do-so here. Or, you can stay up to date with new features from Unity ads by signing up for our monthly newsletter.

    Thanks!
     
  14. karthikveeramani

    karthikveeramani

    Joined:
    Jan 22, 2017
    Posts:
    7
    Thank you all. Just to conclude on this ...

    I stopped using Unity ads as a meditation source. With that gone and after dealing with a few more issues, I got my app to build for iOS. It took me less time to develop the game, including writing a fairly complex AI engine from scratch for my board game, than it took to integrate ads into it. Sad to see the state of this.
     
  15. msclower

    msclower

    Joined:
    May 26, 2017
    Posts:
    13
    I had a similar issue and in my case, I had the latest google admob and unity mediation package but I needed to upgrade my unity ads to a later version. My mistake but the error messages were lacking and others may be in same boat.
     
  16. msclower

    msclower

    Joined:
    May 26, 2017
    Posts:
    13
    This was on IOS.
     
  17. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    I got the same problem. I opened up a bugreport in Google Mobile Ads github [1]. Guess what, they said it's likely not their fault and we should try to contact unity. Let me paste some potentially relevant bits from the github bugreport:

    and the response by the Google team:

    [1] https://github.com/googleads/googleads-mobile-unity/issues/2186
     
  18. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    This bit from the UCB log output seems relevant, but I don't really know what it means. Anybody else with an idea?