Hi all and @LIU_Hanyang96 - @kyle-unity - @Unity_Adamski - @JeffDUnity3D
I’m running into a weird issue with ads. My game has been in Google Play since 2016, and ads still function fine. I was updating things for a new release and although everything is the same, when trying ads on an Android device with my latest build, it doesn’t show the ad. Everything works fine in the editor though.
I’m on 2020.3.38f1 with Unity Ads 3.7.5 (I have to stick with that for now because it’ll break other scripts). I’ve tried different ad SDK’s but getting the same result. I’ve required internet access in player settings, and manually added network access state and internet to the manifest. Product ID’s and dashboard setup is accurate. Not in test mode.
I’d love any help with figuring this out. Thank you!
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
Current Ad’s code I’m running in my first scene to initialize ads:
using UnityEngine;
using UnityEngine.Advertisements;
public class NewUnityAds : MonoBehaviour
{
[SerializeField]
private string
androidGameId = "idgoeshere",
iosGameId = "idgoeshere";
[SerializeField]
private bool testMode;
void Start ()
{
string gameId = null;
#if UNITY_ANDROID
gameId = androidGameId;
#elif UNITY_IOS
gameId = iosGameId;
#endif
if (Advertisement.isSupported && !Advertisement.isInitialized) {
Advertisement.Initialize(gameId, testMode);
}
}
}
The log cat is saying:
2022/10/22 12:28:14.212 20386 20420 Debug UnityAds com.unity3d.services.core.misc.Utilities.writeFile() (line:127) :: Wrote file: /data/user/0/com.companyname.appname/files/UnityAdsStorage-public-data.json
2022/10/22 12:28:14.217 20386 20420 Debug UnityAds com.unity3d.ads.UnityAds.initialize() (line:636) :: ENTERED METHOD
2022/10/22 12:28:14.217 20386 20420 Debug UnityAds com.unity3d.services.ads.UnityAdsImplementation.initialize() (line:72) :: ENTERED METHOD
2022/10/22 12:28:14.254 20386 20483 Info UnityAds com.unity3d.services.core.configuration.InitializeThread$InitializeStateConfig.execute() (line:289) :: Unity Ads init: load configuration from config.unityads.unity3d.com/webview/3.7.5/release/config.json
2022/10/22 12:28:15.315 20386 20577 Info UnityAds com.unity3d.services.core.api.Sdk.logInfo() (line:84) :: Requesting configuration from publisher-config.unityads.unity3d.com/games/
2022/10/22 12:28:15.442 20386 20386 Info chromium [INFO:CONSOLE(0)] “Uncaught (in promise) [object Array]”, source: file:///storage/emulated/0/Android/data/com.companyname.appname/cache/UnityAdsCache/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fconfig.unityads.unity3d.com%2Fwebview%2F3.7.4%2F31a458ff4707db1093f4d425a392de90933316c4%2Frelease%2Findex.html&version=31a458ff4707db1093f4d425a392de90933316c4 (0)
2022/10/22 12:28:15.482 20386 20577 Info UnityAds com.unity3d.services.core.api.Sdk.logInfo() (line:84) :: Requesting ad plan from auction.unityads.unity3d.com/v6/games/
2022/10/22 12:28:14.254 20386 20483 Info UnityAds com.unity3d.services.core.configuration.InitializeThread$InitializeStateConfig.execute() (line:289) :: Unity Ads init: load configuration from config.unityads.unity3d.com/webview/3.7.5/release/config.json
2022/10/22 12:28:14.500 20386 20483 Info UnityAds com.unity3d.services.core.configuration.InitializeThread$InitializeStateLoadCache.execute() (line:346) :: Unity Ads init: webapp loaded from local cache
2022/10/22 12:28:15.298 20386 20591 Warn UnityAds com.unity3d.services.core.connectivity.ConnectivityMonitor.connectionStatusChanged() (line:173) :: Unity Ads was not able to get current network type due to missing permission
2022/10/22 12:28:15.458 20386 20577 Warn UnityAds com.unity3d.services.core.device.Device.getNetworkType() (line:135) :: Unity Ads was not able to get current network type due to missing permission

