Search Unity

Unity Ads works in Editor but not in Device

Discussion in 'Unity Ads & User Acquisition' started by patinvedis, Dec 27, 2017.

Thread Status:
Not open for further replies.
  1. patinvedis

    patinvedis

    Joined:
    Mar 3, 2015
    Posts:
    2
    I read and tried everything I could read about the subject here and elsewhere, but Advertisement.IsReady always returns false in device.
    I have tried with the UnityAds package in the asset store and using the services tab in the editor (not running them both at the same time of course). It works flawlessly in Editor but in the Android device, UnityAds is initialized but always returns false after a call to IsReady.

    I have also looked at the UnityConnectSettings file and it is as recommended here.

    I have logged the adb logcat output and it looks like for some reason the video failed to validate :

    12-27 12:41:05.566 D/UnityAds( 9299): com.unity3d.ads.webview.bridge.WebViewBridgeInterface.handleInvocation() (line:13) :: handleInvocation [["com.unity3d.ads.api.DeviceInfo","getConnectionType",[],"91"],["com.unity3d.ads.api.DeviceInfo","getNetworkType",[],"92"],["com.unity3d.ads.api.DeviceInfo","getNetworkOperator",[],"93"],["com.unity3d.ads.api.DeviceInfo","getNetworkOperatorName",[],"94"],["com.unity3d.ads.api.DeviceInfo","getHeadset",[],"95"],["com.unity3d.ads.api.DeviceInfo","getDeviceVolume",[1],"96"],["com.unity3d.ads.api.DeviceInfo","getScreenWidth",[],"97"],["com.unity3d.ads.api.DeviceInfo","getScreenHeight",[],"98"],["com.unity3d.ads.api.DeviceInfo","getScreenBrightness",[],"99"],["com.unity3d.ads.api.DeviceInfo","getFreeSpace",["INTERNAL"],"100"],["com.unity3d.ads.api.DeviceInfo","getBatteryLevel",[],"101"],["com.unity3d.ads.api.DeviceInfo","getBatteryStatus",[],"102"],["com.unity3d.ads.api.DeviceInfo","getFreeMemory",[],"103"],["com.unity3d.ads.api.Sdk","logDebug",["PLC error Error: Video failed to validate: http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer_legacy.mp4"],"104"],["com.unity3d.ads.api.Sdk","logError",["{\"message\":\"Video failed to validate: http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer_legacy.mp4\",\"name\":\"Error\",\"stack\":\"Error: Video failed to validate: http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer_legacy.mp4\\n at Error (<anonymous>)\\n at file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:14123:19\\n at r (file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:2898:15)\\n at t (file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:2886:39)\\n at l (file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:2787:17)\"}"],"105"],["com.unity3d.ads.api.Sdk","logInfo",["Unity Ads will refresh ads in 3600 seconds"],"106"],["com.unity3d.ads.api.Placement","setPlacementState",["video","NO_FILL"],"107"],["com.unity3d.ads.api.Listener","sendPlacementStateChangedEvent",["video","WAITING","NO_FILL"],"108"],["com.unity3d.ads.api.Placement","setPlacementState",["rewardedVideo","NO_FILL"],"109"],["com.unity3d.ads.api.Listener","sendPlacementStateChangedEvent",["rewardedVideo","WAITING","NO_FILL"],"110"],["com.unity3d.ads.api.Sdk","logDebug",["Unity Ads retrying failed campaign in 108.1751006981358 s

    12-27 12:41:05.566 D/UnityAds( 9299): com.unity3d.ads.webview.bridge.WebViewBridgeInterface.handleInvocation() (line:13) :: econds"],"111"],["com.unity3d.ads.api.Request","post",["3","https://httpkafka.unityads.unity3d.com/v1/events","{\"common\":{\"client\":{\"gameId\":\"1647495\",\"testMode\":true,\"bundleId\":\"com.invedis.plushies\",\"bundleVersion\":\"0.1\",\"sdkVersion\":2102,\"sdkVersionName\":\"2.1.2\",\"platform\":\"android\",\"encrypted\":false,\"configUrl\":\"https://config.unityads.unity3d.com/webview/2.1.2/release/config.json\",\"webviewUrl\":\"https://webview.unityads.unity3d.co...984c0ec47e0b08fc82bee5f3c/release/index.html\",\"webviewHash\":\"e35ff407fab9244512d582cfe9cc918b009c4d6df5b546b4a5b14e4469d39f66\",\"webviewVersion\":\"ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c\",\"initTimestamp\":1514374861930,\"reinitialized\":false},\"device\":{\"apiLevel\":18,\"osVersion\":\"4.3\",\"deviceMake\":\"MID\",\"deviceModel\":\"ONDA A9 Core4\",\"screenLayout\":268435540,\"screenDensity\":320,\"timeZone\":\"CET\",\"language\":\"fr_FR\",\"totalSpaceInternal\":2031440,\"totalSpaceExternal\":24838256,\"totalMemory\":1469896,\"rooted\":false,\"advertisingTrackingId\":\"b0eb72b5-c1dc-4d4e-8d8f-b4b2effd4cd4\",\"limitAdTracking\":false},\"country\":\"FR\"}}\n{\"type\":\"ads.sdk2.diagnostics\",\"msg\":{\"type\":\"auction_request_failed\",\"auction_request_failed\":{\"error\":{\"message\":\"Video failed to validate: http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer_legacy.mp4\",\"name\":\"Error\",\"stack\":\"Error: Video failed to validate: http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer_legacy.mp4\\n at Error (<anonymous>)\\n at file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:14123:19\\n at r (file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:2898:15)\\n at t (file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:2886:39)\\n at l (file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:2787:17)\"}},\"timestamp\":1514374865564,\"adPlan\":\"{\\\"correlationId\\\":\\\"T1Dmk1vhZ5H5ccc06lmWPh\\\",\\\"placements\\\":{\\\"rewardedVideo\\\":\\\"000000000000000000000000\\\",\\\"video\\\":\\\"000000000000000000000000\\\"},\\\"media\\\":{\\\"000000000000000000000000\\\":{\\\"contentType\\\":\\\"comet/campaign\\\",\\\"content\\\":

    12-27 12:41:05.566 D/UnityAds( 9299): com.unity3d.ads.webview.bridge.WebViewBridgeInterface.handleInvocation() (line:13) :: \\\"{\\\\\\\"id\\\\\\\":\\\\\\\"000000000000000000000000\\\\\\\",\\\\\\\"platform\\\\\\\":\\\\\\\"android\\\\\\\",\\\\\\\"store\\\\\\\":\\\\\\\"google\\\\\\\",\\\\\\\"appStoreId\\\\\\\":\\\\\\\"com.iUnity.angryBots\\\\\\\",\\\\\\\"gameId\\\\\\\":11017,\\\\\\\"gameName\\\\\\\":\\\\\\\"Test game android\\\\\\\",\\\\\\\"gameIcon\\\\\\\":\\\\\\\"http://cdn-highwinds.unityads.unity3d.com/impact/11017/test_game_icon.png\\\\\\\",\\\\\\\"rating\\\\\\\":4.5,\\\\\\\"ratingCount\\\\\\\":10000,\\\\\\\"endScreenLandscape\\\\\\\":\\\\\\\"http://cdn-highwinds.unityads.unity3d.com/impact/11017/test_endscreen_landscape.png\\\\\\\",\\\\\\\"endScreenPortrait\\\\\\\":\\\\\\\"http://cdn-highwinds.unityads.unity3d.com/impact/11017/test_endscreen_portrait.png\\\\\\\",\\\\\\\"trailerDownloadable\\\\\\\":\\\\\\\"http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer_legacy.mp4\\\\\\\",\\\\\\\"trailerDownloadableSize\\\\\\\":134924,\\\\\\\"trailerStreaming\\\\\\\":\\\\\\\"http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer.mp4\\\\\\\",\\\\\\\"clickUrl\\\\\\\":\\\\\\\"https://impact.applifier.com/mobile...0507b163822f20000000001?gameId=1647495\\\\\\\",\\\\\\\"videoEventUrls\\\\\\\":{\\\\\\\"video_start\\\\\\\":\\\\\\\"https://impact.applifier.com/mobile...start/000000000000000000000000/1647495\\\\\\\",\\\\\\\"first_quartile\\\\\\\":\\\\\\\"https://impact.applifier.com/mobile...rtile/000000000000000000000000/1647495\\\\\\\",\\\\\\\"midpoint\\\\\\\":\\\\\\\"https://impact.applifier.com/mobile...point/000000000000000000000000/1647495\\\\\\\",\\\\\\\"third_quartile\\\\\\\":\\\\\\\"https://impact.applifier.com/mobile...rtile/000000000000000000000000/1647495\\\\\\\",\\\\\\\"video_end\\\\\\\":\\\\\\\"https://impact.applifier.com/mobile...o_end/000000000000000000000000/1647495\\\\\\\"},\\\\\\\"bypassAppSheet\\\\\\\":false,\\\\\\\"quality\\\\\\\":\\\\\\\"\\\\\\\"}\\\",\\\"trackingUrls\\\":{},\\\"campaignId\\\":\\\"000000000000000000000000\\\",\\\"seatId\\\":9000,\\\"adType\\\":\\\"VIDEO\\\"}},\\\"realtimeData\\\":{\\\"000000000000000000000000\\\":\\\"6mIV6DP8exmeRlpfJwFZA3cf/Hb75tCROzd9gBUR1Wcr5u+IJU4ig3N5jBRQ3fPQgWMJ25Sn0znknywoGFBHiRtm8zoWFYLcufURf/qrcsCFKVhqcgMPsln5odyS+s/wsCjRXre7XiQ4jCG0+W/7Dh2PzJxKcPXhTOxy8+3zo65LhI5tBsCVM8PhOn9VwNIoJ2Ox6HGAU66D0urmIncaSToXBklHWbWRXt6oTp3UorQbGkxPupNCSeZlc7eQeISM50pEBl+7Kgkf/8jg87B7tkazjwI3BYf0UCujy+I63SNx7OcZRZMrzWH+a5xu+Y9G72wkb45Fz8ZawgSSz6oN/q+ABIo0+rPPGxBw\\\"}}\\n\"}}",[["Content-Type","application/json"]],30000,30000],"112"],["com.unity3d.ads.api.Storage","getKeys",["PRIVATE","session",false],"113"]]

    12-27 12:41:05.576 D/UnityAds( 9299): com.unity3d.ads.api.Sdk.logDebug() (line:76) :: PLC error Error: Video failed to validate: http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer_legacy.mp4

    12-27 12:41:05.576 E/UnityAds( 9299): com.unity3d.ads.api.Sdk.logError() (line:58) :: {"message":"Video failed to validate: http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer_legacy.mp4","name":"Error","stack":"Error: Video failed to validate: http://cdn-highwinds.unityads.unity3d.com/impact/11017/blue_test_trailer_legacy.mp4\n at Error (<anonymous>)\n at file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:14123:19\n at r (file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:2898:15)\n at t (file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:2886:39)\n at l (file:///data/data/com.invedis.plushies/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.2%2Fea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c%2Frelease%2Findex.html&version=ea85ac3ebffbbd9984c0ec47e0b08fc82bee5f3c:2787:17)"}

    Sorry for the long post but I really don't know what to do anymore and I am wasting too much time on this.

    Please I would appreciate the input from someone at Unity.

    Thanks for the help!
     
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Thanks, we're investigating on our side. Does it work if you disable testmode?

    /Rasmus
     
  3. patinvedis

    patinvedis

    Joined:
    Mar 3, 2015
    Posts:
    2
    I have not tried to disable test mode as the app is not published yet and i believe it is against your rules.

    I suspect as well that test mode is the culprit here. I have been in contact with support, they asked me to let them know what Advertisement.GetPlacementState() returns, it returns "NoFill" and Advertisement.GetPlacementState("rewardedVideo") returns "NotAvailable. Which is strange since test ad should always be available.

    A I have said to support, the other ad networks (AdColony, Chartboost, AdMob) work fine on the device. But with UnityAds IsReady stubbornly returns false whatever I tried.

    To be thorough, the app is built using Unity 2017.30f3 and I am currently using the latest UnityAds package from the Asset Store (using the services tab instead doesn't help)
     
  4. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Ok, in that case just let support handle the case.

    /Rasmus
     
  5. RKSW

    RKSW

    Joined:
    May 26, 2015
    Posts:
    3
    So, what did Support determine to be the issue. I am seeing the same thing.
     
  6. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @RKSW

    This is a common issue with a lot of possible causes. Would you be able to open a new thread (or support ticket) and provide as much detail as possible. Specifically, we would need:
    • Are you building your game with Unity, XCode, or Android Studio?
    • If Unity, which version are you using?
    • Which version of the Ads SDK are you using?
    • Can you share the code you are using to integrate Unity Ads?
    • Can you provide a device log from your app when Unity Ads is initialized?
    • Are you using mediation? If so, which version of the mediation SDK and adapter are you using?
    • How pervasive is this problem? Is it reproducible 100% of the time or do you have metrics on how often it happens?
     
Thread Status:
Not open for further replies.