iOS Question Problems in Google Ads

hatzisn

Expert
Licensed User
Longtime User
Good afternoon everyone,

I am having problems with the Google Ads in iOS. I am using B4i v8.30 and I have updated the Admob lib as seen here. I get the following as a response in the ad_FailedToReceiveAd events.
success: true
canRequestAds: true
Ad Failed: Error Domain=com.google.admob Code=1 "Request Error: No ad to show." UserInfo={NSLocalizedDescription=Request Error: No ad to show., gad_response_info= ** Response Info **
Response ID: (null)
Network: (null)
** Loaded Adapter Response **
(null)
** Extras Dictionary **
{
}
** Mediation line items **
}
Failed to receive the ad

I have added in Main the correct data as follow:

B4X:
#PlistExtra:<key>GADApplicationIdentifier</key>
#PlistExtra:<string>ca-app-pub-69xxxxxxxxxxxx04~16xxxxxxx8</string>

and I start the banner ad with the correct ad unit code (banner ID) in the corresponding part. Does anyone have any advise?
 
Last edited:

hatzisn

Expert
Licensed User
Longtime User
Thanks, I am not able still to solve it but there has been a progress. If I use the info of this message it displays the test ad correctly:

"If you are using your app in debug or testing mode make sure you are using test AppID and BannerID provided by google admob which would be as:-
Google Test AdMobID: ca-app-pub-3940256099942544~1458002511
Google Test BannerID ca-app-pub-3940256099942544/2934735716
"

If I though return back to my original identifiers it still is returning the same error. I tried also:
1) Resetting my AdvertisingID which for iPhone SE 2016 (iOS 15.8.4) is done with: Settings > Privacy > Tracking > Disallow tracking of Applications > Allow tracking of Applications.
2) Removing the banner from AdMob and adding a new one. This has happened before 10 minutes so I suppose I will have to wait 2-3 hours and test again.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
I tried to ask this to Gemini and the answer I have got is generally: "mind the dimensions, use test ad ids for debugging and change to original IDs uploading afterwards to AppleStore in order for the AdMob to validate the App once you select the Application Store".

I did the first two of them successfully and now that I tried also the 3rd step I am getting this error while uploading:

2025-06-27 11:41:43.321 DEBUG: [altool.600002164200] [ContentDelivery.Uploader.600002164200] BuildID '35eb651a-fb49-4a8c-9802-0af4504f08f5' was deleted.
2025-06-27 11:41:43.324 DEBUG: [altool.600002164200] [ContentDelivery.Uploader.600002164200] Removed the temporary asset directory '~/Library/Caches/com.apple.cds/com.apple.cds_59F96AAA-DD73-4D8F-836B-A6F9B63BEFAD'.
2025-06-27 11:41:43.325 DEBUG: [altool.600002164200] [ContentDelivery.Uploader.600002164200] Removing uploader saved state for identifier 'com.apple.cds_59F96AAA-DD73-4D8F-836B-A6F9B63BEFAD'.
2025-06-27 11:41:43.325 DEBUG: [altool.600002164200] [ContentDelivery.Uploader.600002164200] Show Progress: Upload failed.
Validation failed
The app contains or inherits from non-public classes in Payload/Yacht Companion.app/Yacht Companion: ADBannerView (ID: 70e02e25-2416-4bd3-8892-16c70d54b22f)
2025-06-27 11:41:43.326 INFO: [altool.600002164200] [ContentDelivery.Uploader.600002164200]
=======================================
UPLOAD FAILED with 1 error, 0 warnings, 0 messages
=======================================
2025-06-27 11:41:43.327 DEBUG: [altool.600002164200] [ContentDelivery.Uploader.600002164200] Log file path: ~/Library/Logs/ContentDelivery/com.apple.itunes.altool/com.apple.itunes.altool_Upload_2025-06-27_11-41-14_361.txt
2025-06-27 11:41:43.328 ERROR: [altool.600002164200] Error uploading 'Yacht Companion.ipa'.
2025-06-27 11:41:43.329 ERROR: [altool.600002164200] Validation failed The app contains or inherits from non-public classes in Payload/Yacht Companion.app/Yacht Companion: ADBannerView (ID: 70e02e25-2416-4bd3-8892-16c70d54b22f) (409)
{
NSLocalizedDescription = "Validation failed";
NSLocalizedFailureReason = "The app contains or inherits from non-public classes in Payload/Yacht Companion.app/Yacht Companion: ADBannerView (ID: 70e02e25-2416-4bd3-8892-16c70d54b22f)";
NSUnderlyingError = "Error Domain=IrisAPI Code=-19241 \"Validation failed\" UserInfo={status=409, detail=The app contains or inherits from non-public classes in Payload/Yacht Companion.app/Yacht Companion: ADBannerView , id=70e02e25-2416-4bd3-8892-16c70d54b22f, code=STATE_ERROR.VALIDATION_ERROR, title=Validation failed, NSLocalizedFailureReason=The app contains or inherits from non-public classes in Payload/Yacht Companion.app/Yacht Companion: ADBannerView , NSLocalizedDescription=Validation failed}";
"iris-code" = "STATE_ERROR.VALIDATION_ERROR";
}

What am I doing wrongly? I tried moving the full functionality of the Ads in a class so I can convert it to b4xlib and add it on the fly to new apps. Is it possible with such an approach to cause this error? The application compiles and runs both in Debug mode and also in Release mode. I am using B4i v8.30 and I have updated the Admob lib as seen here.

Here are also the suggestions of Gemini:

It's great that your test ads are working, as that indicates your AdMob SDK implementation is generally correct. Getting a Code=1 error for live ads (often accompanied by "Request Error: No ad to show") is very common when transitioning from test to production.
Here's a breakdown of what you need to do and why you're likely seeing that error:
Understanding AdMob Error Code 1 ("Request Error: No ad to show.")
This error typically means that AdMob couldn't find an ad to return for your request. While it can sometimes indicate an invalid Ad Unit ID or App ID, given that your test ads work, the problem almost always lies with the "readiness" of your app or AdMob account to serve live ads.
Key Steps to Get Live Ads Working:
  1. Ensure You're Using Your Live Ad Unit IDs:
    • Double-check that you've replaced the test Ad Unit IDs (e.g., ca-app-pub-3940256099942544/2934735716 for banner) with the actual Ad Unit IDs you generated in your AdMob account for your specific app.
    • Similarly, ensure your AdMob App ID in your Info.plist (the GADApplicationIdentifier) is your live App ID, not a test one.
  2. Remove Test Device Identifiers from Your Code:
    • When you were debugging, you likely added your device's ID to GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers.
    • Crucially, you must remove this code before building for production. If it's still there, AdMob will continue to serve test ads to that device, even with your live IDs.
  3. App Approval and Linking in AdMob:
    • Your app must be published on the App Store (or another supported app store) for AdMob to fully review and approve it for serving live ads. This is the most common reason for Code=1 when test ads work.
    • Link your app to the App Store in your AdMob account:
      1. Sign in to your AdMob account.
      2. Go to Apps in the sidebar.
      3. Click View all apps.
      4. Find your app and ensure it's linked to its App Store listing. If it's not, you'll need to add the App Store URL.
      5. Once linked, AdMob will automatically begin reviewing your app. You can check its "Approval status" in AdMob (it might show "Getting ready" or "Requires review").
    • Patience is key: The review process can take a few days, or sometimes longer. Ads will only start serving once your app is approved.
  4. AdMob Account Setup & Verification:
    • Complete your AdMob account setup entirely. This includes:
      • Billing information: Ensure your payment details are correctly set up.
      • PIN verification: If you're a new publisher, AdMob will send a PIN to your address once you reach a certain earnings threshold. Your account won't be fully verified for payments until this is done, and this can sometimes impact ad serving.
      • Policy Center: Check your AdMob Policy Center for any violations or issues. Any policy violations will prevent ads from serving.
      • Seller Information: Ensure your seller information is set to "Transparent" in your AdMob settings.
  5. app-ads.txt File (Highly Recommended):
    • While not always a direct cause of Code=1, setting up an app-ads.txt file is crucial for maximizing your ad revenue and preventing unauthorized inventory sales.
    • AdMob provides instructions on how to create and host this file on your developer website. It helps advertisers verify that you are the legitimate seller of your ad inventory.
  6. Network Fill Rate:
    • Sometimes, especially for new apps or in certain regions, AdMob might simply not have an ad to fill every request. This results in a Code=1 (No ad to show). As your app gains users and requests increase, this often resolves itself.
Debugging Checklist for Code=1:
  1. Are you using production Ad Unit IDs and App ID? (Yes, confirmed in your question)
  2. Have you removed all testDeviceIdentifiers code?
  3. Is your app published on the App Store?
  4. Is your app linked to its App Store listing in AdMob?
  5. What is the "Approval status" of your app in AdMob? Is it "Ready" or still "Getting ready"?
  6. Is your AdMob account fully set up and verified (billing, PIN, no policy violations)?
  7. (Optional but recommended) Have you set up your app-ads.txt file?
If you've done all of the above, and your app's status in AdMob is "Ready," but you still get Code=1, then it might be a fill rate issue or something more specific to your account that AdMob support can help with. They often ask for your App ID and Ad Unit IDs to investigate further.
 
Last edited:
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
I figured out what was wrong in uploading to appstoreconnect. I have also added the iAd library besides the iAdMob which refers to Apple Ads which business according to StackOverflow was ended in 2016 and became legacy in 2023. Due to lack of experience in ads I started with all the libraries that start with iAd... 😄 😄 😄
 
Last edited:
Upvote 0
Top