Game crashes on start up after implementing Admob

Hello! I’m sorry to bother you all and I’m sorry if it’s a noob thing to ask for help with, but this issue has been driving me nuts!
I decided to integrate Admob into my Android game and as soon as I did that, the game started crashing after the Unity splashscreen whenever I build that game on my mobile. I tried several solutions from searching on Google from people who had similar issues than me and they all had this issue because they had both Google Game Services and Admob in their games, note that I also have Google Game Service in my game. Though, I’m not sure if that’s still applicable because how many updates to both Google Play Services and Admob have rolled since those people had those issues.
And yes, the game compiles and no errors when run inside the Unity Editor. And it ran perfectly fine on mobile right before adding Admob And it only started crashing once I added it.

Here’s my logcat:

--------- beginning of crash
--------- beginning of system
--------- beginning of main
07-07 10:18:16.996 25689 25714 E Unity   : Unable to find AudioPluginMsHRTF
07-07 10:18:16.997 25689 25714 E Unity   : Unable to find AudioPluginOculusSpatializer
07-07 10:18:16.998 25689 25714 E Unity   : Unable to find libAudioPluginOculusSpatializer
07-07 10:18:17.056 25689 25714 D Unity   :  GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_robustness GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_sync GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_depth_texture_cube_map GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_OES_vertex_array_object GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT
07-07 10:18:17.056 25689 25714 D Unity   : _texture_sRGB_decode GL_EXT_texture_filter_anisotropic GL_EXT_multisampled_render_to_texture GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_disjoint_timer_query

And here’s my Manifest from MainLibProj:

<?xml version="1.0" encoding="utf-8"?>
<!-- This file was automatically generated by the Google Play Games plugin for Unity
     Do not edit. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.example.games.mainlibproj"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="24" />

    <application>

     <!-- Required for Nearby Connections API -->
        <meta-data android:name="com.google.android.gms.nearby.connection.SERVICE_ID"
            android:value="" />

        <!-- the space in these forces it to be interpreted as a string vs. int -->
        <meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="\ My game ID" />
        <meta-data android:name="com.google.android.gms.games.unityVersion"
            android:value="\ 0.9.39a" />
        <meta-data android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

      <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ My game ID"/>
      <meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="\ My game ID"/>

        <activity android:name="com.google.games.bridge.NativeBridgeActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

  
    </application>
</manifest>

My Android Plugins manifest:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.izaron.androideffects.vibration"
      android:versionCode="1"
      android:versionName="1.0">
  <uses-sdk android:minSdkVersion="16" />
  <application android:label="@string/app_name"
               android:icon="@drawable/app_icon"
               after="" android:hardwareAccelerated="true">
    <activity android:name="com.izaron.androideffects.vibration.MyMainActivity"
              android:configChanges="keyboardHidden|orientation"
              android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>

  <uses-permission android:name="android.permission.VIBRATE"/>

</manifest>

My Google Ads manifest:

<?xml version="1.0" encoding="utf-8"?>
<!--
This Google Mobile Ads plugin library manifest will get merged with your
application's manifest, adding the necessary activity and permissions
required for displaying ads.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.unity"
    android:versionName="1.0"
    android:versionCode="1">
  <uses-sdk android:minSdkVersion="16"
      android:targetSdkVersion="24" />
  <application>
  </application>
</manifest>

I’d really appreciate if anyone can guide me to the right place before giving up completely on AdMob. I’m so sorry for bothering you and thanks in advance for your patience with me.

Dont know if you still having issues, but here is what worked for me in case anybody else has the same problem:

So i was having the some problems as you after importing AdMob into my unity-project. As soon as my game started on the android device it crashed.
After many trials i accidentally came across this Plugin 시작하기  |  Unity  |  Google for Developers. I imported this additionally and voila it fixed my problem. No more crashes after that. I dont know what exactly the problem was, but my guess is Unity was missing some files , which were include in the mobile-ads-package, which are not included in Admob(this is weird).

Hope i could help

1 Like

Which plugin?

1 Like

After Implementing ADmob i had the same Issue , After searching for quite a while a found out you need to add AdMob App id into the manifest and swtich to gradle build system , that solved the issue for me.

its the link Look Under "
Set your AdMob app ID
"

And After Doing that Make sure your API level is same in manifest and in unity.
, Hope it helps

3 Likes

@Wolvorine_911 Thanx a ton, your solution worked for me like beauty

Hi,
I am having the same issue, When i remove the plugin the app runs perfectly, but when I add the Admob plugin the app wont launch at all, I also have Google Games Service in my game, and I have also added the app ID to the manifest. I am quite new to unity, and have spent several days trying to solve this issue with no success. Any help would be appreciated

4 Likes

Hey I have found the solution by watching a tutorial on youtube to integrate latest admob 2019 ad in unity. Hope It helps.

2 Likes

did you manage to solve the problem cause i have the same issue

You should open android monitor.bat file from android sdk and then open the app in the phone. Then you will see the error. Then you have to search for that specific error.

1 Like

Once I ticked GoogleAds enabled everything worked -.-

1 Like

This is killing me now. I have being on it for 6 hours straight. Please guys I really need detailed and simple explanation please. My app keeps crashing.

H

Hey introvert you need to debug your application to find the error. You can try this link

https://www.youtube.com/watch?v=XWOf-e9GO1o

APP CRASH 2019 FIXED
After trying everything turns out its the plugin compatibility problem here is the perfect fix for it.

I tried everything around here and nothing was working, it just so happened that I was putting the wrong apps.admob.com id, don’t try to use a test id, create your app on ad mob right away and get the id they give you, then you correctly configure your android id option in “assets/googlemobileads/settings” in the unity, and mark google ad mob as enabled.

Another tip, after making the build, is to check if the id was applied correctly by going to assets / plugins / android / googlemobileadsplugin / androidmanifest open the android manifest and check if in the id’s meta is the id you configured in googlemobileads / settings, example : <android meta-data: name = “com.google.android.gms.ads.APPLICATION_ID” android: value = "SEU_ADMOB_ANDROID_ID /> If you go for it, it probably won’t be your id there, because it automatically applies the id there when you do the build.

I hope it helps someone

1 Like

what I did was deleting admob and I just followed a tutotorial step by step how to implement ads and it worked

hello I went through this issue for weeks and what solved it for me was not using the google admob "
Sample ad unit ID" and using my real AD mob ID. This stopped all crashes.

I got same issue. I realised the whitespace at the end of my app ID :hushed:

1 Like

Thanks man.:smile:

SOLVED !!! SOLVED !!! SOLVED !!! SOLVED !!!
(at least in my case).

Just remove any WHITE SPACES (if any) after App Id:
6900710--807743--Screenshot_8.png

3 Likes

Helped me!

My app too not working after implementing admob in it but before that it works good

After implementing if crash at the start itself…