Unity – Admob Error breaks your codes. Latest stable release as of March 2024

Adding admob connected to your mobile app can be a hassle. You followed tutorials step by step. everything worked fine in the developoment and then later in the release build. boom, hell breaks loose. You search here and there and everywhere with no luck. Searching for answers in forums and asked ai tools with no luck at all. Well, you have found the right place cause this is the solution you need.

For some reason google admob package for unity is problematic. In a way that it breaks in release. The answer to this is not rocket science but a change in the Configuration in the publisher settings. Tick all, you’ll get need it later.

IF you have debug it properly, You will have noticed checking release in minify causes the problem. while in debug all is good. It is because in release, everything is minified. And this causes issues. The Google admob package breaks when that happens. That is why you need to check the custom proguard file. Search for that file in the location in the image. and add this lines.

-keep class com.google.android.gms.ads.** { *; }
-keep class com.google.android.gms.ads.AdRequest { *; }
-keep class com.google.android.gms.ads.AdListener { *; }

This will prevent minification of the admob files and your code will not break.

1 thought on “Unity – Admob Error breaks your codes. Latest stable release as of March 2024”

  1. Pingback: Unity Android - Play games integration common issues - UnsungCoder

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
?>