question

derickrmg avatar image
derickrmg asked

Unity Mobile Ads for Android works in testing mode, but not live

In testing mode, everything works as expected (so it seems that the Start() function is setup and the key is good). But when taken out of testing, the ads fail to load. In debug logs, LoadingStarted = true, but then AdFailedToLoad gets called. The only error in the Logcat pertaining to amazon is: 11-06 13:07:59.916: I/Unity(21416): KeyNotFoundException: The given key was not present in the dictionary. 11-06 13:07:59.916: I/Unity(21416): at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.List`1[com.amazon.mas.cpt.ads.IDelegator]].get_Item (System.String key) [0x00000] in :0 11-06 13:07:59.916: I/Unity(21416): at com.amazon.mas.cpt.ads.AmazonMobileAdsImpl.FireEvent (System.String jsonMessage) [0x00000] in :0 11-06 13:07:59.916: I/Unity(21416): at com.amazon.mas.cpt.ads.AmazonMobileAdsImpl+AmazonMobileAdsBase.UnityFireEvent (System.String jsonMessage) [0x00000] in :0 Does anyone know what could be the problem? Is it a fill issue or an account setup issue?
mobile ads
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

justin avatar image
justin answered
Hi Derickrmg, Thanks for reaching out, and sorry for the delay! Could you please share which country you're pulling these ads from? These KeyNotFoundExceptions haven't been seen to break test ads vs live ads, but if you are in an unsupported country, ads will not display for you. Please note that this does not prevent any users in the supported regions from receiving these ads. Amazon Mobile Ad Network serves ads to users in U.S., U.K., Germany, France, Spain, Italy and Japan. Thanks, Justin
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

derickrmg avatar image
derickrmg answered
Hey, We are in Canada, will that be a problem with testing live ads?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image
Jamie Grossman answered
This could be related. For more info on where these are supported, please see here: https://developer.amazon.com/appsandservices/apis/earn/mobile-ads/docs/faq Otherwise, feel free to contact the team directly with your app key where we can investigate further: https://developer.amazon.com/appsandservices/support/contact/contact-us
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

derickrmg avatar image
derickrmg answered
Ok, it looks like a regional thing...
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
Hi derickrmg, You are right, it is related to the geographical region. Just to clarify, your live app will still function properly in any region, however ads will be served only to users in the U.S., U.K., Germany, France, Spain, Italy and Japan. To solve this, you may implement some logic in onAdFailedToLoad() of your AdListener that will load an ad from an alternative network: https://developer.amazon.com/public/apis/earn/mobile-ads/docs/with-other-sdks Please do not hesitate to contact us with any further queries. For common questions and answers related to ads, please see: https://developer.amazon.com/public/apis/earn/mobile-ads/docs/faq Kind regards, Levon
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Larry avatar image
Larry answered
Hi, I am having this exact same issue. In logcat i am getting returned: I/Unity (28210): AmazonMobileAdsUnityAndroid: Successfully called native code in 22 ms I/Unity (28210): I/Unity (28210): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65) I/Unity (28210): I/Unity (28210): AmazonMobileAdsUnityAndroid: Successfully called native code in 16 ms I/Unity (28210): I/Unity (28210): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65) I/Unity (28210): I/Unity (28210): AmazonMobileAdsUnityAndroid: Successfully called native code in 3 ms I/Unity (28210): I/Unity (28210): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65) I/Unity (28210): I/Unity (28210): Interstitial Started: False I/Unity (28210): I/Unity (28210): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65) I/Unity (28210): I/Unity (28210): AmazonMobileAdsUnityAndroid: Successfully called native code in 699 ms I/Unity (28210): I/Unity (28210): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65) I/Unity (28210): I/Unity (28210): Banner started: True I/Unity (28210): I/Unity (28210): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65) I/Unity (28210): I/Unity (28210): AmazonMobileAdsUnityAndroid: eventReceived I/Unity (28210): I/Unity (28210): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65) I/Unity (28210): I/Unity (28210): KeyNotFoundException: The given key was not present in the dictionary. I/Unity (28210): at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.List`1[com.amazon.mas.cpt.ads.IDelegator]].get_Item (System.String key) [0x00000] in :0 I/Unity (28210): at com.amazon.mas.cpt.ads.AmazonMobileAdsImpl.FireEvent (System.String jsonMessage) [0x00000] in :0 I/Unity (28210): at com.amazon.mas.cpt.ads.AmazonMobileAdsImpl+AmazonMobileAdsBase.UnityFireEvent (System.String jsonMessage) [0x00000] in :0 I've tried this both in test mode and live, same results in the output: Here is my script: http://pastebin.com/DAUaxNWR I am using Unity 5.1, and the latest download of the Amazon SDK which contains the unity package for mobile ads. Just so I'm doing the steps correct, here is my process: 1. I've imported the latest amazon unity ads package 2. I have an app created that generates an app key on my developers account 3. Using my script, I build out an apk 4. Upload that apk file to my app setup on my developers account 5. Install the apk file on my Kindle Fire 6. Run my game and it makes the appropriate calls to DisplayBannerAd() and also RequestInterstitialAd() & DisplayInterstitialAd() Thats it in a nutshell. I can't figure out why [b]I can't see[/b] Amazon banners and Amazon Interstitial ads. NOTE: I am also using AdMob Chartboost to display Chartboost Interstitials for Amazon, they are working perfectly fine. I'm exhausted, frustrated, and honestly about to give on amazon ads, just too dang difficult for me :( [b]P.S. : You guys and gals should consider adding a working demo project to your unity package, really could be a benefit.[/b] Larry Message was edited by: Larry Message was edited by: Larry Message was edited by: Larry
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
Hi Larry, Thanks for sharing your issue. As mentioned earlier in this thread, it is related to the geographic location, so where you are physically located impacts whether you can see the ads in your live (non-test) app. Just a reminder: ads will be served only to users in the U.S., U.K., Germany, France, Spain, Italy and Japan (please see my earlier reply describing this and a possible workaround). Kind regards, Levon
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Larry avatar image
Larry answered
I'm in the U.S. so this shouldn't affect me, if I am understanding correct. Thanks for any help. Larry
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andrew@Amazon avatar image
Andrew@Amazon answered
Larry, you seem to be experiencing a different issue, which may actually be the same issue as discussed on this thread: https://forums.developer.amazon.com/forums/thread.jspa?messageID=22841夹 It appears that some Unity users had to reinstall Unity in order to solve the issue.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Larry avatar image
Larry answered
A little more information as I am still unable to resolve this, even with the latest version of Unity. KeyNotFoundException: The given key was not present in the dictionary. I/Unity (27020): at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.List`1[com.amazon.mas.cpt.ads.IDelegator]].get_Item (System.String key) [0x00000] in :0 I/Unity (27020): at com.amazon.mas.cpt.ads.AmazonMobileAdsImpl.FireEvent (System.String jsonMessage) [0x00000] in :0 I/Unity (27020): at com.amazon.mas.cpt.ads.AmazonMobileAdsImpl+AmazonMobileAdsBase.UnityFireEvent (System.String jsonMessage) [0x00000] in :0 Thanks for any help. Larry
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.