Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question java.lang.RuntimeException: Unable to get provider ....

Discussion in 'Unity Mediation' started by OwlSoftware, Jan 21, 2022.

  1. OwlSoftware

    OwlSoftware

    Joined:
    Aug 10, 2019
    Posts:
    8
    Hi Guys,

    After integrating Unity Mediation Beta based on the tutorial provided by Unity we managed to build the game without problems but once the game has been updated to Google Play, it crashes on launch. I implemented all Ids and everything, game is has been built on api 30.

    java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
    ******************************************************************************
    * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
    * should follow the instructions here: *
    * https://googlemobileadssdk.page.link/admob-android-update-manifest *
    * to add a valid App ID inside the AndroidManifest. *
    * Google Ad Manager publishers should follow instructions here: *
    * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. *
    ******************************************************************************
    at android.app.ActivityThread.installProvider(ActivityThread.java
    at android.app.ActivityThread.installContentProviders (ActivityThread.java:7680)
    at android.app.ActivityThread.handleBindApplication (ActivityThread.java:7500)
    at android.app.ActivityThread.access$1400 (ActivityThread.java:301)
    at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2150)
    at android.os.Handler.dispatchMessage (Handler.java:106)
    at android.os.Looper.loop (Looper.java:246)
    at android.app.ActivityThread.main (ActivityThread.java:8587)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)
    at com.google.android.gms.internal.ads.zzbhw.attachInfo
    at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo
    at android.app.ActivityThread.installProvider (ActivityThread.java:8144)

    If you guys could give a helping hand, we could provide anything that needs fixing this bug.
     
  2. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hello @OwlSoftware ,
    I would assume this is resulting from a typo in your AdMob app IDs. Can you validate that the proper app IDs have been setup in the adapter configuration?
    upload_2022-1-21_11-50-53.png
     
  3. MonishGupta

    MonishGupta

    Unity Technologies

    Joined:
    May 30, 2018
    Posts:
    9
    Alternatively, if you haven't gotten setup with admob or don't plan on using it you can simply uninstall it using the button under the action column.
     
  4. OwlSoftware

    OwlSoftware

    Joined:
    Aug 10, 2019
    Posts:
    8
    Due tot he fact that we exported the app on Android I only had completed the Android column. I will make a build and test with both of them completed, I have already had admob setup

    It was like this.
    Screenshot 2022-01-23 at 09.03.26.png
     
  5. OwlSoftware

    OwlSoftware

    Joined:
    Aug 10, 2019
    Posts:
    8
    Unfortunately even with Ios app Id completed we have trouble. The game is built to target API 30 and minimum I guess 21. This is the error what we get from a api 30 phone.

    AdMob.PNG I will try removing adMob for the moment, and push a version to see if it works.
     
  6. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hi @OwlSoftware ,
    Could you provide a full log so we can properly investigate?

    Thanks!
     
  7. OwlSoftware

    OwlSoftware

    Joined:
    Aug 10, 2019
    Posts:
    8
    How could I provide a full log ? The only log file i have is from google play console, or how could we implement one in order to catch the exception, is there somewhere a tutorial ?

    Thanks
     
  8. OwlSoftware

    OwlSoftware

    Joined:
    Aug 10, 2019
    Posts:
    8
    This is what i have got on my phone while it crashed, i hope you guys could see something. I saw something that class was not found due to CollectionsKt. Shall i provide the implementation of mediation and my package manager ? Maybe I am missing something ?

    Screenshot_20220124-102523.png Screenshot_20220124-102519.png Screenshot_20220121-134257.png
     
  9. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    I would recommend using adb logcat, or your favourite editor to extract the log. using adb you would open a console and do something like
    adb logcat > myLog.txt 
    with your phone plugged through usb.
     
  10. zeroBudget

    zeroBudget

    Joined:
    Nov 14, 2019
    Posts:
    62
    Bumping because I am having the same issue.

    This is the logcat:

    upload_2022-5-21_16-28-58.png

    Why is this happening?
     
  11. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hi @zeroBudget,

    Do you have your admob App Ids correctly set up as shown in this post ?

    Thanks for sharing this issue with us, let us know if the setup mentioned above fixes your issue.
     
  12. zeroBudget

    zeroBudget

    Joined:
    Nov 14, 2019
    Posts:
    62
    That's strange, I don't see that section for Mediation and Ad Adapters.
    upload_2022-5-24_16-20-47.png

    This is all I have for services:
    upload_2022-5-24_16-22-46.png


    This is the app id. Do I need the iOS one? All I'm trying to do is build for Android to test it on my phone.
    View attachment 1059401
    Should I uninstall and reinstall the Google Mobile Ads Plugin?
     

    Attached Files:

  13. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hi @zeroBudget ,
    It seems like you do not have the Unity Mediation package installed. If you are using google's ads plugin directly I would recommend you refer to their documentation regarding how to use their plugin.
     
    zeroBudget likes this.