Android Question Having a problem with Real Ads don't show in Firebase AdMobs

Lyndon Bermoy

Active Member
Licensed User
Longtime User
Hi. It's been a month and I haven't figured out what causes the error of not showing the real ads in b4a. When I'm using the Test AdUnitID everything works fine and I see the test ad. But when I put my own AdUnitID using https://apps.admob.com, the ads just don't show.

Here's the error in the unfiltered logs:

test ads.png
 

asales

Expert
Licensed User
Longtime User
1 - Use "code" tags when posting code (not image).

2 - Follow this instructions:
Initialize MobileAds in Service_Create of the Starter service (not in the sub "ads" in the Main activity)

3 - Check this example:
 
Upvote 0

Lyndon Bermoy

Active Member
Licensed User
Longtime User
1 - Use "code" tags when posting code (not image).

2 - Follow this instructions:
Initialize MobileAds in Service_Create of the Starter service (not in the sub "ads" in the Main activity)

3 - Check this example:

I have already done that with my previous thread: https://www.b4x.com/android/forum/t...ont-using-firebase-admobs.116527/#post-740137

Erel wanted me to post again with this kind of problem since I cannot reply in the last previous thread.
 
Upvote 0

Lyndon Bermoy

Active Member
Licensed User
Longtime User
The real ads are now showing using the debug keys. All thanks to you @asales :) But when I created my private sign key, the real ads now won't appear but when I use debug key then it will appear. How to fix this? I want to upload my first app in Playstore.
 
Upvote 0

Lyndon Bermoy

Active Member
Licensed User
Longtime User
I cannot attach the file because the file is too big. It is just same with your sample here: https://www.b4x.com/android/forum/threads/the-almost-definitive-admob-example.113586/ I just downloaded this sample project of firebase admobs of yours and successfully run with my real ads coming from admobs, when i created the private sign key instead of using the default debug key, my real ads won't show. When i try to go back and replace it with the default debug key, it will show again the real ads, why is this happening?
 
Upvote 0

asales

Expert
Licensed User
Longtime User
why is this happening?
I don't know.
I cannot attach the file because the file is too big.
Not your complete project.
Create a small example only to test the ads.
If you is using the same code of the example, the export file is not too big. You need to use the menu "File / Export As Zip".
- change the package name of the example
- create a firebase project to test, with the new package name
- download the google-services.json and use it in the example
- create new ad units in the Admob to this example
- compile the example with the test ad units and with the real ad units
- use your private key (not the debug key) to compile
- check the logs, unfiltered logs and the subs of the ads

Some tips:
1 - check if your device is not marked with developer device or beta tester in Google Console
2 - check if the sub AdFailedToLoad show any error to load the ad
 
Upvote 0

asales

Expert
Licensed User
Longtime User
I checked your example (that you sent to me in PM) and works fine here.
This image below show the ads.
Maybe the problem could be related with the admob consent, your country or other part of the code that I don't saw.
Maybe @Erel or other members could help you here.

TestAds1.jpg
 
Upvote 0

Lyndon Bermoy

Active Member
Licensed User
Longtime User
Thank you sir @asales for the insights, I checked also back now the unfiltered log, it says
B4X:
type=1400 audit(0.0:6931577): avc: denied { read } for name="boot_mode" dev="sysfs" ino=5339 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0

Do you have any idea what's this?

I don't know also if Philippines has an admob consent here. I really don't know what to do. Purchased b4a six years ago but until now I cannot monetize my apps in Google Playstore.

Anyway, Thank you so much sir.
 
Upvote 0

Lyndon Bermoy

Active Member
Licensed User
Longtime User
I run again my sample test ads now sir and this shows now in filtered logs
 

Attachments

  • error1.png
    error1.png
    12.2 KB · Views: 206
Upvote 0

Lyndon Bermoy

Active Member
Licensed User
Longtime User
Please post logs as text, not screenshot.
Ok sir.

I run again my sample test ads now sir and this shows now in filtered logs

B4X:
Consent state: UNKNOWN
EU:False
AdViewBanner FailedToReceiveAd:3

and this in the unfiltered logs

B4X:
Logger connected to:  OPPO CPH1723
--------- beginning of main
Ad failed to load : 3
AdViewBanner FailedToReceiveAd: 3
Ad failed to load : 3
Do partial code cache collection, code=40KB, data=58KB
After code cache collection, code=40KB, data=58KB
Increasing code cache capacity to 256KB
Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("240518AB7A3CEC22E21D2A00686727A0") to get test ads on this device.
Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("240518AB7A3CEC22E21D2A00686727A0") to get test ads on this device.
Not retrying to fetch app settings
Ad failed to load : 3
Ad failed to load : 3
AdViewBanner FailedToReceiveAd: 3
Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("240518AB7A3CEC22E21D2A00686727A0") to get test ads on this device.
Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("240518AB7A3CEC22E21D2A00686727A0") to get test ads on this device.
Not retrying to fetch app settings
Ad failed to load : 3
Ad failed to load : 3
Log reader error: java.io.InterruptedIOException: read interrupted
-1 received
writer error
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2010)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2044)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:358)
    at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
    at java.lang.Thread.run(Thread.java:761)
Starting remote logger. Port: 58572
After accept
logcat arg /system/bin/logcat.
logcat arg -v.
logcat arg raw.
Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("240518AB7A3CEC22E21D2A00686727A0") to get test ads on this device.RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("240518AB7A3CEC22E21D2A00686727A0") to get test ads on this device.
Not retrying to fetch app settings
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Lyndon Bermoy

Active Member
Licensed User
Longtime User
Upvote 0
Top