Search Unity

Bug Unity Showing Real Ads in test mode

Discussion in 'Unity Ads & User Acquisition' started by abhishekbandiya04, Oct 25, 2022.

  1. abhishekbandiya04

    abhishekbandiya04

    Joined:
    Mar 8, 2022
    Posts:
    3
    Hello folks, I am facing an issue where real ads are shown instead of the test ones in android devices . I have kept test mode on and even in debug logs it is verifiable that test mode variable is true.

    Scenario:
    1. Install the app first time to android device and run (test ads will be shown)
    2. Install the app again as an update(i.e. without uninstalling) and run (real ads will be shown)

    I have used build and run option from build settings to install the app. I have even created a sample project to test this and it still shows real ads. This has caused some unwanted ad impressions to my project, would really like some help to remove those.

    Unity Editor version: 2021.3.6f1 and 2021.3.11f1
    Advertisement package version: 3.7.5
    Code used from: https://docs.unity.com/ads/ImplementingRewardedAdsUnity.html

    Logs during real ads run:
    2022/10/26 03:54:50.020 24038 24074 Info Unity --- Starting Ads Initialization from here ---
    2022/10/26 03:54:50.088 24038 24074 Debug UnityAds com.unity3d.services.core.misc.Utilities.writeFile() (line:127) :: Wrote file: /data/user/0/com.DefaultCompany.TestProject/files/UnityAdsStorage-public-data.json
    2022/10/26 03:54:50.089 24038 24074 Debug UnityAds com.unity3d.services.core.device.Storage.sendEvent() (line:86) :: Couldn't send storage event to WebApp
    2022/10/26 03:54:50.093 24038 24074 Debug UnityAds com.unity3d.services.core.misc.Utilities.writeFile() (line:127) :: Wrote file: /data/user/0/com.DefaultCompany.TestProject/files/UnityAdsStorage-public-data.json
    2022/10/26 03:54:50.093 24038 24074 Debug UnityAds com.unity3d.services.core.device.Storage.sendEvent() (line:86) :: Couldn't send storage event to WebApp
    2022/10/26 03:54:50.098 24038 24074 Debug UnityAds com.unity3d.ads.UnityAds.initialize() (line:636) :: ENTERED METHOD
    2022/10/26 03:54:50.098 24038 24074 Debug UnityAds com.unity3d.services.ads.UnityAdsImplementation.initialize() (line:72) :: ENTERED METHOD
    2022/10/26 03:54:50.098 24038 24074 Debug UnityAds com.unity3d.services.UnityServices.initialize() (line:36) :: ENTERED METHOD
    2022/10/26 03:54:50.112 24038 24074 Info UnityAds com.unity3d.services.UnityServices.initialize() (line:129) :: Initializing Unity Services 3.7.5 (3750) with game id 4941113 in test mode
    2022/10/26 03:54:50.115 24038 24074 Info UnityAds com.unity3d.services.UnityServices.initialize() (line:146) :: Unity Services environment check OK
    2022/10/26 03:54:50.152 24038 24212 Info UnityAds com.unity3d.services.core.configuration.InitializeThread$InitializeStateConfig.execute() (line:289) :: Unity Ads init: load configuration from https://config.unityads.unity3d.com/webview/3.7.5/release/config.json
    2022/10/26 03:54:50.186 24038 24074 Debug CompatibilityChangeReporter Compat change id reported: 147600208; UID 10494; state: ENABLED
    2022/10/26 03:54:50.194 24038 24074 Debug AudioManagerExtImpl getStreamVolume packageName=com.DefaultCompany.TestProject, index=3, streamType=3
    2022/10/26 03:54:50.387 24038 24212 Info UnityAds com.unity3d.services.core.configuration.InitializeThread$InitializeStateLoadCache.execute() (line:346) :: Unity Ads init: webapp loaded from local cache
    2022/10/26 03:54:50.402 24038 24038 Warn any.TestProjec Entry not found
    2022/10/26 03:54:50.402 24038 24046 Info any.TestProjec Background young concurrent copying GC freed 5214(1159KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 7923KB/7923KB, paused 8.839ms,298us total 27.091ms
    2022/10/26 03:54:50.408 24038 24038 Info WebViewFactory Loading com.google.android.webview version 106.0.5249.126 (code 524912634)
    2022/10/26 03:54:50.418 24038 24038 Info any.TestProjec Waiting for a blocking GC ClassLinker
    2022/10/26 03:54:50.426 24038 24038 Info any.TestProjec WaitForGcToComplete blocked ClassLinker on Background for 8.153ms
    2022/10/26 03:54:50.430 24038 24038 Info cr_WVCFactoryProvider Loaded version=106.0.5249.126 minSdkVersion=29 isBundle=true multiprocess=true packageId=2
    2022/10/26 03:54:50.444 24038 24038 Info cr_LibraryLoader Successfully loaded native library
    2022/10/26 03:54:50.445 24038 24038 Info cr_CachingUmaRecorder Flushed 9 samples from 9 histograms.
    2022/10/26 03:54:50.527 24038 24038 Debug CompatibilityChangeReporter Compat change id reported: 171228096; UID 10494; state: ENABLED
    2022/10/26 03:54:50.598 24038 24046 Info any.TestProjec Background young concurrent copying GC freed 5678(480KB) AllocSpace objects, 5(7148KB) LOS objects, 0% free, 17MB/17MB, paused 5.067ms,64us total 37.147ms
    2022/10/26 03:54:50.624 24038 24239 Warn cr_media BLUETOOTH_CONNECT permission is missing.
    2022/10/26 03:54:50.624 24038 24239 Warn cr_media registerBluetoothIntentsIfNeeded: Requires BLUETOOTH permission
    2022/10/26 03:54:50.643 24038 24266 Info AdrenoGLES-0 QUALCOMM build : 1159e70389, I1027f1d7d9
    2022/10/26 03:54:50.643 24038 24266 Info AdrenoGLES-0 Build Date : 04/08/22
    2022/10/26 03:54:50.643 24038 24266 Info AdrenoGLES-0 OpenGL ES Shader Compiler Version: EV031.32.02.17
    2022/10/26 03:54:50.643 24038 24266 Info AdrenoGLES-0 Local Branch :
    2022/10/26 03:54:50.643 24038 24266 Info AdrenoGLES-0 Remote Branch :
    2022/10/26 03:54:50.643 24038 24266 Info AdrenoGLES-0 Remote Branch :
    2022/10/26 03:54:50.643 24038 24266 Info AdrenoGLES-0 Reconstruct Branch :
    2022/10/26 03:54:50.643 24038 24266 Info AdrenoGLES-0 Build Config : S P 10.0.7 AArch32
    2022/10/26 03:54:50.643 24038 24266 Info AdrenoGLES-0 Driver Path : /vendor/lib/egl/libGLESv2_adreno.so
    2022/10/26 03:54:50.650 24038 24266 Info AdrenoGLES-0 PFP: 0x016dd093, ME: 0x00000000
    2022/10/26 03:54:50.675 24038 24038 Info Quality Skipped: true 2 cost 48.449135 refreshRate 0 processName com.DefaultCompany.TestProject
    2022/10/26 03:54:51.024 24038 24283 Warn UnityAds com.unity3d.services.core.api.Sdk.logWarning() (line:78) :: {"message":"model: DeviceInfo key: openAdvertisingTrackingId with value: null: null is not in: string,undefined","name":"CheckValueError"}
    2022/10/26 03:54:51.491 24038 24296 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/26 03:54:51.497 24038 24296 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/26 03:54:51.518 24038 24283 Info UnityAds com.unity3d.services.core.api.Sdk.logInfo() (line:84) :: Requesting configuration from https://publisher-config.unityads.u...V8lhSXy1senbn3b6wkzotfSoHpAxVXXryZI83YeP9cGk=
    2022/10/26 03:54:51.853 24038 24283 Info UnityAds com.unity3d.services.core.api.Sdk.logInfo() (line:84) :: Received configuration for token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHAiOjMyLCJhcHBMZXZlbENvcHBhIjp0cnVlLCJhdHQiOjAsImF1YyI6MjM1LCJhdWkiOjEzMSwiYXpwIjoiY2U5ZGFjOTItNmQ3Yy00Y2ViLWFkZWQtNDI0MWVhMTBiY2FjIiwiY2FsY3VsYXRlZENvcHBhIjp0cnVlLCJjb25zZW50IjpmYWxzZSwiY29udGV4dHVhbE9ubHkiOmZhbHNlLCJjcGkiOjEyOCwiY3JlYXRlZCI6MTY2NjczNTk3NTAwMCwiZGx0IjowLCJkdCI6MCwiZXR0IjpbMjE0NzQ4Mzk0Niw4NjIyLDg3NTQsNzMxMCw4NjA5LDg0NzIsNzYxMCw1NzU2LDg0MDcsNTM0NSw4NjcyLDc4NzUsODY3NSw4NjUwLDg3NjEsNTM0OSw4NDA2LDg3MzksNzM0Niw4NzE4XSwiZXhwIjoxNjY3OTQ2MjkwLCJpYXAiOjEyMiwiaWF0IjoxNjY2NzM2NjkwLCJpZyI6InVSVE5UbGRBZDlTOW1adCtyYm11NkJCUFRpNUlQaGo4YnhxOXdVYVpScW5YZysrcGIwV0lzRTJLK2hrK041NmRQSkVjU1E9PSIsImluc3RhbGxhdGlvbklkIjoiZGRiODY0OTdiMjAyZDA5MjI4MzZjYjFjZjIwMjVhODUiLCJpciI6ImV4cmJaRXhuUGNpSFdzbzI4ODdMQjNwMVkwUGg5MUVVeVhjMENWTW1sdE5WKzg0NUNpOWNSanQzbXlkNkpNK0l2QU9kdzZrNEVLeWJJcnVoS29MdGZnPT0iLCJpc3MiOiJhZHMtc2RrLWNvbmZpZ3VyYXRpb24udW5pdHlhZHMudW5pdHkzZC5jb20iLCJsZWdhbFRlcnJpdG9yeSI6MCwibHR2IjoxNTgsIm1peGVkIjpmYWxzZSwicHJvIjoyMTAsInByb3hpZWQiOmZhbHNlLCJzcyI6IjZkNzRhNGE4LWM2MjUtNDU0Yi1iMmYyLTAxYWVkZmJjZmQ4ZSIsInN1YiI6IjJZdVlOZkhpaS9aQlgzaTR5WWlqYzFra0dhWVdGdTJnT29kcmxXYmZ0amF5eXJoelQvcjhTZ0htOTQ4QzdDckpqWGZhWlE9PSIsInRndCI6OTAsInhwciI6MjE5fQ.Bep6qXjN_3fep8mmGORIHQ5xIlc4RMgTDB2uu0SG2OQ (A/B group 7)
    2022/10/26 03:54:51.916 24038 24038 Info Unity Unity Ads initialization complete.
    2022/10/26 03:54:51.931 24038 24283 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
    2022/10/26 03:54:51.932 24038 24283 Debug AudioManagerExtImpl getStreamVolume packageName=com.DefaultCompany.TestProject, index=12, streamType=1
    2022/10/26 03:54:51.938 24038 24283 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
    2022/10/26 03:54:53.314 24038 24283 Info UnityAds com.unity3d.services.core.api.Sdk.logInfo() (line:84) :: Webview started using the latest version
    2022/10/26 03:54:57.826 24038 24074 Info Unity Loading Ad: Rewarded_Android
    2022/10/26 03:54:57.876 24038 24283 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
    2022/10/26 03:54:57.881 24038 24283 Debug AudioManagerExtImpl getStreamVolume packageName=com.DefaultCompany.TestProject, index=12, streamType=1
    2022/10/26 03:54:57.891 24038 24283 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
    2022/10/26 03:54:59.059 24038 24038 Info Unity Ad Loaded: Rewarded_Android
    2022/10/26 03:55:01.173 24038 24283 Info UnityAds com.unity3d.services.core.api.Sdk.logInfo() (line:84) :: Opening performance ad unit with orientation PORTRAIT, hardware acceleration enabled
    2022/10/26 03:55:01.245 24038 24074 Debug any.TestProjec PlayerBase::stop() from IPlayer
    2022/10/26 03:55:01.245 24038 24074 Debug AudioTrack stop(18008): prior state:STATE_ACTIVE output 13 stream 3 session 130297
    2022/10/26 03:55:01.245 24038 24074 Debug AudioTrack stop(18008): called with 674496 frames delivered
    2022/10/26 03:55:01.297 24038 24038 Debug WindowManager Add to mViews: DecorView@79224c1[AdUnitActivity],pkg= com.DefaultCompany.TestProject
    2022/10/26 03:55:01.299 24038 24337 Debug ExtensionsLoader createInstance(32bit) : createExtendedFactory
    2022/10/26 03:55:01.303 24038 24337 Debug ExtensionsLoader Opened libhwuiextimpl.so
    2022/10/26 03:55:01.303 24038 24038 Debug ExtensionsLoader createInstance(32bit) : createExtendedFactory
    2022/10/26 03:55:01.304 24038 24038 Debug ExtensionsLoader Opened libSchedAssistExtImpl.so
    2022/10/26 03:55:01.312 24038 24038 Info Quality Skipped: false 2 cost 35.31306 refreshRate 0 processName com.DefaultCompany.TestProject
    2022/10/26 03:55:01.333 24038 24038 Verbose OplusZoomWindowDecorViewHelper setLastReportedMergedConfiguration mZoomDisplayHeight: 2400 getDecorView.127018177
    2022/10/26 03:55:01.395 24038 24136 Debug SurfaceComposerClient VRR [FRTC] client handle [bufferId:18446744073709551615 framenumber:0] [ffffffff, ffffffff]
    2022/10/26 03:55:01.415 24038 24038 Info Quality Skipped: false 5 cost 88.466545 refreshRate 0 processName com.DefaultCompany.TestProject
    2022/10/26 03:55:01.580 24038 24074 Error BLASTBufferQueue BLASTBufferItemConsumer::eek:nDisconnect()
    2022/10/26 03:55:01.582 24038 24038 Error BLASTBufferQueue BLASTBufferItemConsumer::eek:nDisconnect()
    2022/10/26 03:55:01.582 24038 24038 Error BLASTBufferQueue [ViewRootImpl[UnityPlayerActivity]#0](f:0,a:0) Applying pending transactions on dtor 1
    2022/10/26 03:55:01.590 24038 24038 Info Quality Skipped: false 8 cost 146.76387 refreshRate 0 processName com.DefaultCompany.TestProject
    2022/10/26 03:55:01.616 24038 24038 Info Quality Skipped: true 1 cost 22.871815 refreshRate 0 processName com.DefaultCompany.TestProject
    2022/10/26 03:55:01.667 24038 24038 Debug MediaPlayerNative getMetadata
    2022/10/26 03:55:01.827 24038 24239 Info AAudio AAudioStreamBuilder_openStream() called ----------------------------------------
    2022/10/26 03:55:01.827 24038 24239 Info AudioStreamBuilder rate = 48000, channels = 2, format = 5, sharing = SH, dir = OUTPUT
    2022/10/26 03:55:01.827 24038 24239 Info AudioStreamBuilder device = 0, sessionId = -1, perfMode = 12, callback: ON with frames = 192
    2022/10/26 03:55:01.827 24038 24239 Info AudioStreamBuilder usage = 1, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
    2022/10/26 03:55:01.827 24038 24239 Info AudioStreamBuilder privacy sensitive = false
    2022/10/26 03:55:01.827 24038 24239 Info AudioStreamBuilder opPackageName = (null)
    2022/10/26 03:55:01.827 24038 24239 Info AudioStreamBuilder attributionTag = (null)
    2022/10/26 03:55:01.827 24038 24239 Debug any.TestProjec PlayerBase::playerBase()
    2022/10/26 03:55:01.832 24038 24239 Debug any.TestProjec PlayerBase::playerBase()
    2022/10/26 03:55:01.832 24038 24239 Debug AudioStreamInternal_Client ~AudioStreamInternal() 0xab47bf00 called
    2022/10/26 03:55:01.832 24038 24239 Debug AAudioStream ~AudioStream(s#1) mPlayerBase strongCount = 1
    2022/10/26 03:55:01.832 24038 24239 Debug any.TestProjec PlayerBase::~PlayerBase()
    2022/10/26 03:55:01.832 24038 24239 Debug AudioStreamTrack open(), request notificationFrames = -8, frameCount = 0
    2022/10/26 03:55:01.832 24038 24239 Debug AudioTrackExtImpl AudioTrackExtImpl init
    2022/10/26 03:55:01.832 24038 24239 Debug AudioTrack set() streamType -1, sampleRate 48000, format 0x5, channelMask 0x3, frameCount 0, flags #104, notificationFrames -8, sessionId 0, transferType 1, uid -1, pid -1 cbf 1
    2022/10/26 03:55:01.832 24038 24239 Debug AudioTrack set(): Building AudioTrack with attributes: usage=1 content=2 flags=0x0 tags=[]
    2022/10/26 03:55:01.867 24038 24239 Info AudioTrack createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST successful; frameCount 0 -> 1536
    2022/10/26 03:55:01.867 24038 24239 Info AudioTrack createTrack_l(18009) on outputId(13) : 0xa80fd400, mCblk = 0xe876d100, mLatency = 80, mAfLatency = 48, frameCount = 1536, mSampleRate = 48000, mFlags = 0x4, mReqFrameCount = 1536, mNotificationFramesAct = 192
    2022/10/26 03:55:01.867 24038 24239 Verbose ListServiceUtils checkInListByUid module:audio-choppy-boost uid:10494 cost 133us return (null)
    2022/10/26 03:55:01.868 24038 24239 Debug AudioTrack setVolume left 1.000 right 1.000 , callingPid 24038
    2022/10/26 03:55:01.868 24038 24239 Debug AAudioStream setState(s#2) from 0 to 2
    2022/10/26 03:55:01.868 24038 24239 Debug AudioStreamTrack open() flags changed from 0x00000104 to 0x00000004
    2022/10/26 03:55:01.870 24038 24239 Info AAudio AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#2 ----------------
    2022/10/26 03:55:01.872 24038 24239 Debug AAudio AAudioStream_requestStart(s#2) called --------------
    2022/10/26 03:55:01.872 24038 24239 Debug AAudioStream setState(s#2) from 2 to 3
    2022/10/26 03:55:01.872 24038 24239 Debug AudioTrack start(18009): prior state:STATE_STOPPED output 13 stream 3 session 130313
    2022/10/26 03:55:01.911 24038 24239 Debug AAudio AAudioStream_requestStart(s#2) returned 0 ---------
    2022/10/26 03:55:01.915 24038 24052 Debug AudioStreamLegacy onAudioDeviceUpdate(deviceId = 3)
    2022/10/26 03:55:01.916 24038 24038 Debug MediaRouter onRestoreRoute() : route=RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }​

    Let me know if anything else is needed from my side. Thanks for the help.
     
  2. Unity-Boon

    Unity-Boon

    Unity Technologies

    Joined:
    Jan 18, 2017
    Posts:
    135
    Suggest you update the Unity Ads SDK to 4.0.1 or above, as it is required for your app to get approved by Google Play Store. Can you try it again after that and let us know if you still have any issues?
     
  3. abhishekbandiya04

    abhishekbandiya04

    Joined:
    Mar 8, 2022
    Posts:
    3
    I tried Advertisement package versions 4.1.0 and 4.3.0, its reproducible with both of them.
     
  4. Unity-Boon

    Unity-Boon

    Unity Technologies

    Joined:
    Jan 18, 2017
    Posts:
    135
    Another possibility is your project is COPPA-enabled, which wouldn't allow Unity Ads to collect device data and serve test ads. Can you check on that as well?
     
  5. abhishekbandiya04

    abhishekbandiya04

    Joined:
    Mar 8, 2022
    Posts:
    3
    I indeed have that enabled but sometimes it shows test ads and other time it shows real ones. Are there any suggestions on how to go forward with this?
     
  6. krupps

    krupps

    Joined:
    Oct 17, 2017
    Posts:
    159
    I submitted a bug for this. Banner Ads show real ads and video and interstitial show test ads. Andy contacted me yesterday
     
  7. arnumagustina766

    arnumagustina766

    Joined:
    Dec 19, 2022
    Posts:
    3
    Why do Rewarded videos or Interstitial video testmodes become heavy and have long video durations?