Search Unity

Unity Monetization 3.0 xcode build failed

Discussion in 'Unity Ads & User Acquisition' started by marek1990, Dec 5, 2018.

  1. marek1990

    marek1990

    Joined:
    Dec 9, 2015
    Posts:
    8
    Hello,

    I want to give a try to IAP Promotions so I decided to update ADS and IAP plugins. On Android everything works as expected but I have some issues on iOS.

    When building in Xcode I have an error:

    "Lexical or Preprocessor Issue"
    'UnityAds/UnityMonetization.h' file not found
    UnityMonetizationUnityWrapper.mm

    In Plugins/iOS UnityAds.framework is present, also in Xcode under Unity-iPhone/Frameworks/Plugins/iOS/UnityAds.framework is present.

    My Xcode version is 10.1. I have downloaded Unity Monetization 3.0 from AssetStore and import IAP plugin from Services -> In-App Purchasing. All plugins are in latest versions downloaded today.

    For now I've tried:
    1. Build using Unity 5.6.4p4 and 2018.2.9f1
    2. pod deintegrate, clean, update install and run project from *.xcodeproj and *.xcworkspace.
    3. Run everything on other mac.

    Other plugins in project:
    - Google Mobile Ads
    - Firebase auth and app
     
  2. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    bigbrainz likes this.
  3. marek1990

    marek1990

    Joined:
    Dec 9, 2015
    Posts:
    8
    I will try it in free time. Thank you. For now I decided to use latest UnityAds and UnityIap plugin without Unity Monetization 3.0. Promo iap works and I'am fine with that :)
     
  4. jtbentley

    jtbentley

    Joined:
    Jun 30, 2009
    Posts:
    1,397
    After bringing a project up from Unity 3 all the way to 2018, ran into this same issue (likely the result of an ancient build post process), this solution did solve it :)
     
  5. kgbv

    kgbv

    Joined:
    Jun 5, 2013
    Posts:
    13
    i have my project in unity 2018.2.21f1 . after exporting to ios as Xcode project i am facing the same error

    "Lexical or Preprocessor Issue"
    'UnityAds/UnityMonetization.h' file not found
    UnityMonetizationUnityWrapper.mm.

    i tried your options but it didn't worked . even i also used ios resolver to install cocoa pods in unity itself . still no result .
    any help will be appreciated.
     
  6. Flying_Moose

    Flying_Moose

    Joined:
    Feb 28, 2019
    Posts:
    1
    I've got the same issue, did anyone find an answer?
     
  7. Mest

    Mest

    Joined:
    Nov 7, 2012
    Posts:
    18
    Hello everybody,
    I had the same issue, after upgrading my project from 2019.x to 2020.3.
    To find the error i created a fresh 2020-Project, implemented all plugins/Settings of my ported Main-Project and noticed, that the "Assets/Plugins/" Folder has not even nearly the same content, as of my Main-Project.

    Turned out my old Project has some old-version-related Plugin-Files!

    And that was the fix, deleting unnecessary old files (make a backup before, if you delete to much):
    - "Assets/Plugins/iOS/UnityAnalyticsWrapper.mm"
    - "Assets/Plugins/iOS/UnityJsonAdditions.mm"
    - and so on

    Just watch out you only delete the stuff your "temp-new-project" don't has, related to the plugins you are observing (in my case it was "Unity-Analytics", "Unity-Purchasing", "UDP" and "Unity-Ads"). Seems most stuff is moved to the "Package"-Folder.

    Hope this helps
     
  8. cdr9042

    cdr9042

    Joined:
    Apr 22, 2018
    Posts:
    173
    I had this issue when updating Google Admob SDK 6.1.2 to 7.0.0 and Admob Mediation's Unity Adapter.

    error: Build input file cannot be found: '/(path)/Libraries/com.unity.ads/Plugins/iOS/UnityMonetizationUnityWrapper.m' (in target 'UnityFramework' from project 'Unity-iPhone')

    My solution was to find the folder Libraries/com.unity.ads in XCode's directory tab, the folder were marked red (it means they don't exist in the hard drive anymore), then delete the folder.
     
  9. msclower

    msclower

    Joined:
    May 26, 2017
    Posts:
    13
    My solution was simplier. I had the latest versions of Admob and the admob/unity mediation package but my UNity Ads version was a previous version. Upgrading the unity ads version to match the admob/unity mediation package resolved the compilation issue.