Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Interstitial and rewarded ads crash app when executing Advertisement.Show

Discussion in 'Unity Ads & User Acquisition' started by LordVise, Oct 3, 2023.

  1. LordVise

    LordVise

    Joined:
    Aug 1, 2020
    Posts:
    7
    I am trying to implement Unity Ads (Advertisement Legacy v4.4.2), but the Android app crashes when I try to execute Advertisement.Show for interstitial and rewarded ads in test mode. The loading of the ads seems to be successful, but I cannot show them. Banners work correctly. When running on the PC editor, the app works correctly. I get the same problem when running a simple app as well as the sample app that comes with the package.
    From Android Logcat I get a number of warning messages before the crash of "com.unity3d.services.core.device.Device.getNetworkType() (line:148) :: Unity Ads was not able to get current network type due to missing permission".
    I am using a custom Android Manifest file with only the following permissions added, based on various forums I have read:
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>

    I am using Android API level 33 and I have set this as my target API version in the Project Player settings.
    I have uninstalled any potential ad blockers and restarted the device.

    Can anyone please let me know if there is anything that I am missing?
    Thanks for any help or suggestions.
     
  2. LordVise

    LordVise

    Joined:
    Aug 1, 2020
    Posts:
    7
    As an update to the above, after several hours of testing, I found that having 2 browsers installed on the Android device was causing the problem. I uninstalled the Samsung Internet app (even though it was not the default browser) and just left the Chrome browser. The Unity Ads now work normally, without crashing. Also, no custom Manifest is needed. I am still getting the Logcat warning mentioned above, but this does not affect the display of the ads from what I can see.