Error on iOS using latest Admob Unity Plugin

772 views
Skip to first unread message

CidQu

unread,
May 15, 2023, 4:51:41 PM5/15/23
to Google Mobile Ads SDK Developers
Hello, I have issues with Admob. It works fine on Android but crashes every time at startup on ios using Unity. What can I do to fix it? Here is the AdManager code. I don't know what to do anymore tried everything online. It works fine without the AdMob plugin.

"Error: libc++abi: terminating with uncaught exception of type Il2CppExceptionWrapper"


AdManager.cs

Mobile Ads SDK Forum Advisor

unread,
May 16, 2023, 5:51:40 AM5/16/23
to hitth...@gmail.com, google-adm...@googlegroups.com
Hello,
 
Thank you for reaching out to us.
 
For us to properly troubleshoot your issue, kindly provide us the following information below privately:
  • Sample App
  • Steps to replicate
  • App ID
  • SDK Version
  • Complete Stack Trace Error
  • Device name and versions affected
You can provide the following details via reply privately to author option or directly provide it to the link below.
If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:
 
1. Navigate to
https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002lIBuzQAG&entry.80707362=00179112
2. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Regards,
Google Logo Mobile Ads SDK Team

 

ref:_00D1U1174p._5004Q2lIBuz:ref

CidQu

unread,
May 17, 2023, 5:30:36 AM5/17/23
to Google Mobile Ads SDK Developers
Thank you so much I added all my unity code. You can just start the game and it will try to load ad and will crash.

Mobile Ads SDK Forum Advisor

unread,
May 18, 2023, 6:44:27 AM5/18/23
to hitth...@gmail.com, google-adm...@googlegroups.com
Hi CidQu,

Thank you for providing the requested information. However, we're getting a build error on our end. With that, could you kindly export the unity project to both Android and iOS platform, then provide it to us via the steps shared on this thread? Let us know here once you've uploaded the exported project file.

CidQu

unread,
May 18, 2023, 3:25:27 PM5/18/23
to Google Mobile Ads SDK Developers
I uploaded new archive with already builded ios file. Game crashed at first startup

Mobile Ads SDK Forum Advisor

unread,
May 19, 2023, 2:49:41 PM5/19/23
to hitth...@gmail.com, google-adm...@googlegroups.com
Hello,

Thank you for responding back to us. With that, allow me to raise this concern to the rest of our team to expedite the investigation. One of our team should be able to provide more information on the issue. Kindly wait patiently while we do our investigations.

This message is in relation to case "ref:_00D1U1174p._5004Q2lIBuz:ref"

Thanks,

 
Google Logo Mobile Ads SDK Team


CidQu

unread,
May 22, 2023, 5:47:34 AM5/22/23
to Google Mobile Ads SDK Developers
If you need any help with the unity. I forgot to say the build version.

This project was made using 2021.3.13f1, builds with no error but when I run it crashes at startup while loading google ad manager.

Mobile Ads SDK Forum Advisor

unread,
May 31, 2023, 8:46:11 AM5/31/23
to hitth...@gmail.com, google-adm...@googlegroups.com
Hi CidQu,

My name is Nick and I will be helping you with the exception you are seeing with the Rewarded Ad.  Il2CppExceptionWrapper can be caused a number of issues, many of which are outside the scope of Google mobile ads. That said I do see a number of problems with the provided code.

1. The RegisterEventHandlers call needs to be moved inside the Load callback.
        RewardedAd.Load(_adUnitId, adRequest,
            (RewardedAd ad, LoadAdError error) =>
            {
                // if error is not null, the load request failed.
                if (error != null || ad == null)
                {
                    Debug.LogError("Rewarded ad failed to load an ad " +
                                   "with error : " + error);
                    return;
                }

                Debug.Log("Rewarded ad loaded with response : "
                          + ad.GetResponseInfo());

                rewardedAd = ad;  
                RegisterEventHandlers(rewardedAd);
            });
        RegisterEventHandlers(rewardedAd);


2. We should be safe and handle callbacks on the Unity main thread.

Hope this helps,

- Nick



ref:_00D1U1174p._5004Q2lIBuz:ref
Reply all
Reply to author
Forward
0 new messages