Hello. I’m trying to set up rewarded ads for an android app. I am using the implementation guide from this link: Implementing rewarded ads in Android
At first glance, everything works. Until I try to display the loaded ad by calling UnityAds.show(). As a result of the call, a black screen with 2 buttons is displayed. Mute and GDPR. The buttons work, but the video is not displayed. After a few seconds, this screen will close.
The following lines are output to the log:
I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:100) :: Displaying Ad with creativeId test-landscape-id
I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:100) :: Opening performance(v) ad unit with orientation PORTRAIT, hardware acceleration enabled
D/TrafficStats: tagSocket(185) with statsTag=0xffffffff, statsUid=-1
E/SurfaceSyncer: Failed to find sync for id=0
W/Parcel: Expecting binder but got null!
E/SurfaceSyncer: Failed to find sync for id=0
E/UnityAds: com.unity3d.services.core.request.WebRequestRunnable.makeRequest() (line:70) :: Error completing request: Response code: Unacceptable certificate: CN=DigiCert Global Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US
V/MediaHTTPService: MediaHTTPService(android.media.MediaHTTPService@6d5d344): Cookies: null
W/UnityAds: com.unity3d.services.core.device.Device.getNetworkType() (line:152) :: Unity Ads was not able to get current network type due to missing permission
V/MediaHTTPService: makeHTTPConnection: CookieManager created: java.net.CookieManager@a01dc2d
V/MediaHTTPService: makeHTTPConnection(android.media.MediaHTTPService@6d5d344): cookieHandler: java.net.CookieManager@a01dc2d Cookies: null
D/TrafficStats: tagSocket(94) with statsTag=0xffffffff, statsUid=-1
D/TrafficStats: tagSocket(95) with statsTag=0xffffffff, statsUid=-1
E/UnityAds: com.unity3d.services.ads.video.VideoPlayerView$2.run() (line:74) :: Video player prepare timeout: https://cdn-creatives-akamaistls-prd.acquire.unity3dusercontent.com/impact/11017/blue_test_trailer.mp4
E/UnityAds: com.unity3d.services.core.api.Sdk.logError() (line:88) :: Unity Ads video player prepare timeout https://cdn-creatives-akamaistls-prd.acquire.unity3dusercontent.com/impact/11017/blue_test_trailer.mp4
E/MediaPlayerNative: stop called in state 4, mPlayer(0x7a020c65dd10)
E/MediaPlayerNative: error (-38, 0)
This is true for both the emulator and physical devices with different versions of Android.
Internet access permissions are specified in the manifest.
UnityAds version:4.6.0
If the GDPR button is clicked to open the agreement, test ads can be displayed, but without calling onUnityAdsShowComplete.
What could be causing this strange behaviour?
UPD:
The problem was solved if initialization was called not in test mode.
That is
UnityAds.initialize(_activity, _unity_game_ID, false , _initialization_listener);
Hope this bug will be fixed in the future.