HMS-Core / hms-ads-demo-java

HUAWEI Ads SDK sample code. HUAWEI Ads SDK provides the banner, native, rewarded, interstitial and splash ad formats for integration.
https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/ads-sdk-introduction?ha_source=hms1
Apache License 2.0
57 stars 20 forks source link

Ad failed with error code 0 - onAdFailed error code 499 #15

Open sametguzeldev opened 3 years ago

sametguzeldev commented 3 years ago

Hello.

I am testing your apk on EMUI 8 and Android version 8 tablet that has HMS Core 6.0.0.304. I am getting Ad failed with error code 0 - onAdFailed error code 499 for all ad types. It works for EMUI & Android 10 Version but doesn't work below that. When I check the official page it says EMUI 3.0 or later is enough. image

Here is the log: com.huawei.hms.ads.sdk-logcat.txt

Thanks in advance.

Mike-mei commented 3 years ago

It shows that your network failed in your log, requesting ads requires internet access. 20210729-162917(WeLinkPC)

sametguzeldev commented 3 years ago

I do have a working connection. It did popped up two consent pop ups and I've accepted them. I can make a video recording if needed.

Mike-mei commented 3 years ago

Sure, please provide your video record.

sametguzeldev commented 3 years ago

The video was more than 10MB so I could not upload that to here. Please watch it from here

I show my Wi-Fi settings and I browse through AppGallery at the start to prove that I have an active working internet connection. Then I open the application and you can see the results. I accept two consents but still ad error code 0.

Mike-mei commented 3 years ago

In order to locate your issue quickly, please run the following command to obtain full logs:

  1. adb logcat -v time >d:/hwads.txt
  2. Reproduce the problem scenario.
  3. Press Ctrl + C and copy the log to here
sametguzeldev commented 3 years ago

Hello there. I will be sending it today!

sametguzeldev commented 3 years ago

Here are the logs you've requested. hwads.txt

I've done the same steps as the video and only in the app. Tried to load banner and Interstitial Ads.

Mike-mei commented 3 years ago

It shows in your log: countryCode by ro.product.locale.region is:US, is your local area set to the US? The area should be set to other regions except for the US. Method for setting regions in your phone: settings-> system -> language and input -> language and region -> region

sametguzeldev commented 3 years ago

Hello again.

I've gone into system > language and input > language. But I don't see anything related to changing the region. I can only change device language. My AppGallery region is set to Turkey. Screenshot_20210806-100427

I've also used adb shell getprop to see it and as you've said it says it is the US. image

But I don't know how to change it. I tried to change it with setprop but did not work.

Mike-mei commented 3 years ago

Click the language here then you can see the button to change region. image

sametguzeldev commented 3 years ago

I've already checked that before sending it to you but only has an option to add a language. Currently UK is selected. Screenshot_20210806-115800

The three dot on the top right corner only offers to "Remove Preferred Language" fyi

sametguzeldev commented 3 years ago

Any updates on this ? 😄

Mike-mei commented 3 years ago

Please insert a SIM card (except US) into your phone and try again.