Adding AdMob Causes App Crash (Android)

92 views
Skip to first unread message

Ty G

unread,
Jun 3, 2024, 12:28:38 PMJun 3
to Google Mobile Ads SDK Developers
Maybe I'm missing something obvious but if I simply import the AdMob unity package or install AdMob using the UPM my app will thenceforth fail to start on android devices. 
I can add a banner ad to the editor, and the emulator has no issues but if I install the APK to my Samsung S22 Ultra it crashes even before showing the "made with unity" splash screen. 
I'm testing by just creating a new project and importing the unity package and building the otherwise blank app and it crashes instantly. Just having the code added to the project seems to be breaking it without even referencing it in the app. 
I did have to go back to AdMob version 8.7.0 before I could get it to build the app at all. Anything newer fails to build. I've tried with many different versions of the unity editor to see it that had an effect and I have yet to get a successful build that runs on a device with the AdMob package added to the project.
The resolver seems to be happy and the package imports without error. 
I'm starting to doubt that it will ever work and I'm not seeing how it can be so widely used with all the trouble I've had getting something so basic to work. 
I haven't plugged my AdMob account ID in anywhere but I've used the test accounts thinking it might be missing the ID and crashing because of that but it doesn't seem to matter, it crashes regardless. 
Any ideas what painfully obvious step I must be missing?

Mobile Ads SDK Forum Advisor

unread,
Jun 3, 2024, 6:32:01 PMJun 3
to tyro...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for contacting the Mobile Ads SDK Support team.

Could you confirm whether you have followed all the steps to Import the Mobile Ads for Unity plugin.

If you are migrating from using a .unitypackage to using OpenUPM, you must manually uninstall the assets from the old location. Remove the following directories that were imported from the .unitypackage:

  • Assets/ExternalDependencyManager
  • Assets/GoogleMobileAds
  • Assets/Plugins/Android/googlemobileads-unity.aar
  • Assets/Plugins/Android/GoogleMobileAdsPlugin
  • Assets/Plugins/iOS/GADUAdNetworkExtras
  • Assets/Plugins/iOS/unity-plugin-library.a

 I hope this helps! Let me know if you have any other questions.

This message is in relation to case "ref:!00D1U01174p.!5004Q02tJAiu:ref" (ADR-00237843)

Thanks,
 
Google Logo Mobile Ads SDK Team


Ty G

unread,
Jun 5, 2024, 4:32:26 AMJun 5
to Google Mobile Ads SDK Developers
This is just using AdMob in general. Has nothing to do with switching from UPM to unitypackage or visa versa. 
Is it odd that I can't build essentially a blank project with AdMob package added and get it to run on a device?
It seems like this should work with most configurations and I've tried dozens without a single success. 
I've tried 4 different computers, half a dozen unity editor versions, and all the unitypackages that were compatible. 
I still can't build a blank scene and have it run on the phone. I have no issues if the AdMob package is left out though. 

Mobile Ads SDK Forum Advisor

unread,
Jun 5, 2024, 9:14:02 AMJun 5
to tyro...@gmail.com, google-adm...@googlegroups.com
Hi,

Can you confirm whether you are facing same issue with our sample project. If you are able to run our sample project in your device then there might be some issue in your implementation. If you unable to run our sample project also kindly share the crash logs for further investigation.

Mobile Ads SDK Forum Advisor

unread,
Jun 11, 2024, 10:39:16 PMJun 11
to tyro...@gmail.com, google-adm...@googlegroups.com

Hi,

Can you confirm whether you are facing the same issue with our Google sample project? If you can run our sample project on your device then there might be some issues in your implementation. If you are unable to run our sample project then kindly share the below details for further investigation privately.

  • app ID
  • ad unit ID
  • SDK version being used
  • Crash logs/Stack trace
  • Breakdown of device/OS versions affected

You can provide the following details via reply privately to the author option 

Reply all
Reply to author
Forward
0 new messages