Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

No matching function for call to NSStringFromIl2CppString

Discussion in 'Unity IAP' started by kilicbatuhan1205, Dec 22, 2019.

Thread Status:
Not open for further replies.
  1. kilicbatuhan1205

    kilicbatuhan1205

    Joined:
    Dec 20, 2018
    Posts:
    27
    Hey guys,

    today I implemented IAP into my game, but when trying to build in XCode I get this error:
    No matching function for call to NSStringFromIl2CppString in class UnityMonetizationPurchasingAdapter.mm
    I am using the Unity Monetization Asset, Unity Ads is disabled, In-App-Purchasing service is enabled.

    Does anyone know why this is happening?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    That looks like a possible error from the Unity Monetization Asset and not IAP. Can you test on a new/empty project with only the one asset? Also, make sure you have the latest version of XCode and all the assets. The latest version of IAP is 1.23.1
     
  3. Chunderstorm

    Chunderstorm

    Joined:
    May 23, 2013
    Posts:
    4
    I'm getting this issue now -- Unity 2018.4.5.f1. Brought in the Ad and In-App Purchase packages from the Package Manager. Build is failing in Xcode. Advertisement is version 3.4.1, IAP is 2.0.6.

    edit: attached a screenshot of the function that's failing w/ errors.
     

    Attached Files:

    Last edited: Dec 28, 2019
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So it sounds like an issue with Ads then, you import IAP via the Services window. Otherwise the Purchasing package is not used.
     
  5. Chunderstorm

    Chunderstorm

    Joined:
    May 23, 2013
    Posts:
    4
    That tracks -- been awhile since I imported a lot of these packages. Anything I can do in the meantime, or any solutions you can think of for me to try?
     
  6. kilicbatuhan1205

    kilicbatuhan1205

    Joined:
    Dec 20, 2018
    Posts:
    27
    @Chunderstorm
    I fixed the error by removing all Unity Service Assets and then reimporting them.
     
  7. Chunderstorm

    Chunderstorm

    Joined:
    May 23, 2013
    Posts:
    4
    @kilicbatuhan1205 Unfortunately that didn't do much for me. :/ Build still fails in Xcode.
     
  8. Chunderstorm

    Chunderstorm

    Joined:
    May 23, 2013
    Posts:
    4
    Fyi, this worked in a blank project with the following:
    -Ads version 2.0.8
    -IAP version 2.0.6

    We tried bringing our game to Ads version 3.4.1 from the PackageManager down to version 2.0.8, but with no luck. We're still experimenting to see if we can reproduce it in the blank project.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Make sure you have the latest XCode also
     
  10. mc100401985

    mc100401985

    Joined:
    Dec 4, 2014
    Posts:
    3
    getting same errors in xcode. using xcode latest version and unity 2018.1.
    tried with different version of IAP and ads but did not work
     

    Attached Files:

  11. Larry-B

    Larry-B

    Joined:
    Jan 26, 2016
    Posts:
    4
    Same issue happens to us with both Unity 2019.2.0 and Unity 2019.2.14. Tried several times to remove the Unity Services related files, reimported from the services tab but with no luck
    Xcode 11.3, macOS Catalina
     
    Last edited: Jan 1, 2020
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide minimum steps to reproduce on an empty project. It's it Ads or IAP that's causing it? IAP is version 1.23.1 (not the Package Manager version)
     
  13. locobrandgames

    locobrandgames

    Joined:
    Aug 2, 2019
    Posts:
    1
    did someone find the solution how to solve this issue?
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Once we get minimal steps to reproduce, we can likely provide a solution.
     
  15. leandro_trick

    leandro_trick

    Joined:
    Oct 29, 2014
    Posts:
    14
    I think I'm having the same issue. Latest Xcode, Unity 2019.2.17f, latest Advertisement package from Package Manager (3.4.1)

    The methods are in the file UnityAdsUtilities.h but for some reason the files referencing them can't either find NSStringFromIl2CppString or UnityAdsCopyString (referenced in UnityBannerUnityWrapper).

    These look like some kind of bug with the latest Advertisement package.
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Better posted in the Ads forum https://forum.unity.com/forums/unity-ads.67/
     
    leandro_trick likes this.
  17. leandro_trick

    leandro_trick

    Joined:
    Oct 29, 2014
    Posts:
    14
  18. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Hey, I'm having this issue with IAP.

    unity version 2018.4.33f1
    Unity IAP from package manager - v2.2.2
    Unity Ads from package manager - v3.7.1

    I'm getting this in xCode:

    builder.productId = NSStringFromIl2CppString(pProduct->productId);
    Error - No matching function for call to 'NSStringFromIl2CppString'

    I've tried removing Ads and IAP Asset store packages and files uninstalling and reinstalling the packages from the package manager for both Ads and IAP and I'm getting this error still. which versions should i be using? How do i solve this?


    Edit:
    I see that -Ads version 2.0.8 is the verified one, but there's no documentation for it. I get this error when i try to downgrade to it.
    Assets/Scripts/Advertising/UnityAdProvider.cs(13,60): error CS0246: The type or namespace name 'IUnityAdsShowListener' could not be found (are you missing a using directive or an assembly reference?)

    Going to the documentation for Ads says v3.7.1 should work for 2018.4.18+

    Documentation for Ads v2.0 on the ads documentation page links you back to the unity manual which links you back to the ads documentation page. Yay.


    Semi Solution (works for android):

    Unity version 2018.4.33f1
    Unity IAP from package manager - v2.2.2
    Don't user Ads from package manager - Install the Unity Monetization asset from the asset store. Uninstall Ads from package manager.
     
    Last edited: Apr 15, 2021
  19. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I'm still having real trouble getting Ads to work on both iOS and Android, my solution above worked but only for an android build... switching to iOS again and I get this error now:


    Undefined symbols for architecture arm64:

    "UnityAdsCopyString(char const*)", referenced from:

    -[UANAEngineWrapper addExtras:] in UnityAnalyticsWrapper-0808ab2871822a35d13a88fccae3675a8314f1d318dd25ceffded7b5910fcba1.o

    ld: symbol(s) not found for architecture arm64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  20. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would want to post in the Ads support forum https://forum.unity.com/forums/unity-ads.67/ Locking this thread now
     
Thread Status:
Not open for further replies.