Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Unity Mediation merged into IronSource LevelPlay build successful, app crash exits

Discussion in 'Unity Ads & User Acquisition' started by 71kris, Jan 26, 2023.

  1. 71kris

    71kris

    Joined:
    Aug 13, 2013
    Posts:
    17
    Unity 2021.3.17f
    IronSource 7.2.7
    Unity Ads 4.3.29.2
    AdMob 4.3.46.0
    Android Build to Samsung S6 Android v.7

    I merged Unity Mediation into LevelPlay on dashboard.unity3d.com.
    I set it up on Iron Source
    I connected sdk networks for IronSource, Unity Play, AdMob (API Failed for Google Ad Mob but AdMob Native API OK).
    My game is in development. It has not been published yet. I've been trying to 3 days to make it work following official ironsource level play docs and also a youtube video link below.
    I'm unable to deploy to a test device. Build is successful and then crash exit.

    Logcat reports:
    Code (CSharp):
    1. 0001/01/01 00:00:00.000 -1 -1 Info  --------- beginning of main
    2. 2023/01/26 21:19:29.828 13086 13086 Error Zygote v2
    3. 0001/01/01 00:00:00.000 -1 -1 Info  --------- beginning of system
    4. 2023/01/26 21:19:29.829 13086 13086 Info libpersona KNOX_SDCARD checking this for 10253
    5. 2023/01/26 21:19:29.829 13086 13086 Info libpersona KNOX_SDCARD not a persona
    6. 2023/01/26 21:19:29.832 13086 13086 Error Zygote accessInfo : 0
    7. 2023/01/26 21:19:29.832 13086 13086 Warn SELinux SELinux selinux_android_compute_policy_index : Policy Index[2],  Con:u:r:zygote:s0 RAM:SEPF_SECMOBILE_7.0_0010, [-1 -1 -1 -1 0 1]
    8. 2023/01/26 21:19:29.835 13086 13086 Info SELinux SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=com.MyUnityAndIronSourceCompanyName.MyProjectTitle
    9. 2023/01/26 21:19:29.846 13086 13086 Info art Late-enabling -Xcheck:jni
    10. 2023/01/26 21:19:29.901 13086 13086 Debug TimaKeyStoreProvider TimaKeyStore is not enabled: cannot add TimaSignature Service and generateKeyPair Service
    11. 2023/01/26 21:19:30.415 13086 13086 Debug AndroidRuntime Shutting down VM
    12. 0001/01/01 00:00:00.000 -1 -1 Info  --------- beginning of crash
    13. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime FATAL EXCEPTION: main
    14. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime Process: com.MyUnityAndIronSourceCompanyName.MyProjectTitle, PID: 13086
    15. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
    16. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime
    17. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime ******************************************************************************
    18. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
    19. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * should follow the instructions here:                                       *
    20. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * https://googlemobileadssdk.page.link/admob-android-update-manifest         *
    21. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * to add a valid App ID inside the AndroidManifest.                          *
    22. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * Google Ad Manager publishers should follow instructions here:              *
    23. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest.   *
    24. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime ******************************************************************************
    25. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime
    26. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime
    27. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at android.app.ActivityThread.installProvider(ActivityThread.java:6329)
    28. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at android.app.ActivityThread.installContentProviders(ActivityThread.java:5918)
    29. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5857)
    30. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at android.app.ActivityThread.-wrap3(ActivityThread.java)
    31. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
    32. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at android.os.Handler.dispatchMessage(Handler.java:102)
    33. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at android.os.Looper.loop(Looper.java:154)
    34. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at android.app.ActivityThread.main(ActivityThread.java:6682)
    35. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at java.lang.reflect.Method.invoke(Native Method)
    36. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
    37. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
    38. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime Caused by: java.lang.IllegalStateException:
    39. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime
    40. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime ******************************************************************************
    41. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
    42. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * should follow the instructions here:                                       *
    43. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * https://googlemobileadssdk.page.link/admob-android-update-manifest         *
    44. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * to add a valid App ID inside the AndroidManifest.                          *
    45. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * Google Ad Manager publishers should follow instructions here:              *
    46. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest.   *
    47. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime ******************************************************************************
    48. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime
    49. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime
    50. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at com.google.android.gms.ads.internal.client.zzek.attachInfo(com.google.android.gms:play-services-ads-lite@@21.4.0:26)
    51. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@21.4.0:1)
    52. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     at android.app.ActivityThread.installProvider(ActivityThread.java:6326)
    53. 2023/01/26 21:19:30.432 13086 13086 Error AndroidRuntime     ... 10 more
    54.  
    Can someone please help to resolve it. Can LevelPlay be deployed to a game that was not published yet?

    Link to a video that I also followed but for me Ironsource DemoScene crashes on deploy to a device. My own game scenes build deployed to a device also crashes.
    Video:
     
  2. 71kris

    71kris

    Joined:
    Aug 13, 2013
    Posts:
    17
    Finding a solution - progress:
    I managed to make some progress with resolving my problems migrating from Unity Mediation to LevelPlay.
    For anyone having similar problems here's what seems to have worked for me to some extent. This is for test ads.

    - First of all I had a backup of my project. I started fixing with a copy from a backup. I removed Unity Mediation from the project. I switched off Services -> Ads in project settings as turning it "ON" broke the build for me.

    - I followed this step to get rid of "Play Services" folder from my project. That was there for Unity Mediation I believe:
    https://developers.ironsrc.com/ironsource-mobile/unity/ironsource-integration-manager-unity/#step-3
    (review step 1 and 2 on the same page).
    - I followed the section "External Dependency Manager Changes" in there.
    It replaced Play Services pacakges with "Assets -> Mobile Dependency Resolver" option in the Editor. This replaced old "Play Services" folder and option to resolve android.

    - I still couldn't get test banner ads loading with only iron source installed in Unity -> Ads Mediation tab (that appears at the top of the Untiy Editor once Ironsource SDK was installed).
    I was getting "empty waterfall" result in debug log but I managed to deploy build to my android device. Empty waterfall probably means there's no ad available (?). I couldn't find much info on that anywhere so I decided to enable Banner Unity Ads (non-existent in Unity Mediation if I'm correct but existing in Unity Ads).

    - So I enabled Unity Ads banner ad on IronSource -> SDK Networks Setup page - I was moving from Unity Mediation and had no banner ad setup on unity Dashboard Monetization before. I set this up on both Unity Dashboard and on Ironsource.

    - Having tested it with level play ironsource and unity ads installed in unity I can see unity banner test ad loading and test interstitial iron source ad also loading, at least for now. I haven't tested rewarded ad yet.

    - Changes to gradleTemplate.properties in Assets -> Plugins -> Android
    On top of adding:
    android.enableDexingArtifactTransform=false in gradleTemplate.properties in Assets -> Plugins -> Android I had to add
    android.useAndroidX=true
    android.enableJetifier=true
    in there as well.
    (If anyone could explain what these two settings are, why they're required that would be great).

    Without these two settings my build failed. Adding them solved the problem with building to a device, launching the game and getting Banner and Interstitial Ads loading.

    To get gradleTemplate file it has to be enabled (ticked) in Project Settings -> Player -> Build.
    While in there it also required to enable (tick) two extra boxes:
    1. Custom Main Manifest
    2. Custom Base Gradle Template - watch the video I linked in my post above for details. It really helped me to get going.

    - I got Test Rewarded Ad loading too.

    - For Google AdMob I installed AdMob via Ads Mediation -> Integration Manager window in the Editor.
    I had to go to navigate to Assets -> IronSource -> Plugins -> Android -> IronSource.plugin -> AndroidManifest.xml <-- This is the second(!) AndroidManifest file on top of Assets -> Plugins -> Android -> AndroidManifest.xml, and in there I added my AdMob App ID like this:

    Code (CSharp):
    1. <manifest>
    2.     <application>
    3.         <!-- Sample AdMob app ID: ca-app-pub-XXXXXXXX-XXXXXX -->
    4.         <meta-data
    5.             android:name="com.google.android.gms.ads.APPLICATION_ID"
    6.             android:value="ca-app-pub-xxxxADMOBxxxAPPID~yyyyyyyyyy"/>
    7.     </application>
    8. </manifest>
    This solved the problem with Google AdMob integration for Test Ads for me.

    I thought I share my findings if anyone's interested.
     
    Last edited: Jan 28, 2023
  3. aylin_unity3d

    aylin_unity3d

    Unity Technologies

    Joined:
    Apr 6, 2015
    Posts:
    48
    Hi, @71kris thanks for sharing your finding. If you encounter any other issues while migrating from unity mediation to level play, please let us know.
     
  4. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    I have the same bug at runtime even thought I added the application ID.
    The migration process to levelplay is tedious and has many errors in the documentation, still didn't manage to make it work unfortunately
     
  5. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    When I add the APPLICATION_ID meta-data it disappear after building
     
  6. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    I had to use a menu to add it that is not documented, that's many many little things like that that makes the migration tedious (And I'm not in the iOS phase yet :D).
    I used Ads Mediation then Developer Settings then Mediated network settings
     
    nobluff67 likes this.
  7. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    100% absolutely agree. I wonder how many people have given up on this migration/implementation due to hidden steps, broken links, outdated screenshots and outdated documentation. I was one step away from giving up on this headache and moving to admob mediation, until I found this link ( I have had to search for a least 6 different solutions to various issues with regards to this migration). And this is just for Android so far.
     
  8. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    Making it work is not the end though. Every update is the same headache, I tried to update levelplay it bugged for no reasons and nothing in my control so I'm switching to admob now (plus I had terrible ecpm compared to unity mediation)
     
    nobluff67 likes this.
  9. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    for their defense it might not be 100% their fault (except the ecpm), I'm migrating to admob and there are troubles too.
    I don't know if it's just me but everytime I try to get out of unity it's a mess.
    For example with admob you integrate the adapters yourself (instead of clicking update you have to download a .unitypackage and double click it), some adapters can cause troubles and make the whole build fails
     
    nobluff67 likes this.