أخطاء في تحميل الإعلانات

في الحالات التي يتعذّر فيها تحميل إعلان، يتمّ استدعاء دالّة ردّ اتصال تقدّم عنصرًا LoadAdError.

بالنسبة إلى AdView، يتمّ استدعاء ما يلي:

يوضّح المثال التالي المعلومات المتاحة عند تعذُّر تحميل إعلان:

Kotlin

override fun onAdFailedToLoad(error: LoadAdError) {
  // Gets the domain from which the error came.
  val errorDomain = error.domain
  // Gets the error code. See
  // https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest#constant-summary
  // for a list of possible codes.
  val errorCode = error.code
  // Gets an error message.
  // For example "Account not approved yet". See
  // https://support.google.com/admob/answer/9905175 for explanations of
  // common errors.
  val errorMessage = error.message
  // Gets additional response information about the request. See
  // https://developers.google.com/admob/android/response-info
  // information.
  val responseInfo = error.responseInfo
  // Gets the cause of the error, if available.
  val cause = error.cause
  // All of this information is available using the error's toString() method.
  Log.d("Ads", error.toString())
}

Java

@Override
public void onAdFailedToLoad(LoadAdError error) {
  // Gets the domain from which the error came.
  String errorDomain = error.getDomain();
  // Gets the error code. See
  // https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest#constant-summary
  // for a list of possible codes.
  int errorCode = error.getCode();
  // Gets an error message.
  // For example "Account not approved yet". See
  // https://support.google.com/admob/answer/9905175 for explanations of
  // common errors.
  String errorMessage = error.getMessage();
  // Gets additional response information about the request. See
  // https://developers.google.com/admob/android/response-info
  // for more information.
  ResponseInfo responseInfo = error.getResponseInfo();
  // Gets the cause of the error, if available.
  AdError cause = error.getCause();
  // All of this information is available using the error's toString() method.
  Log.d("Ads", error.toString());
}
بالنسبة إلى الأخطاء ضمن النطاق MobileAds.ERROR_DOMAIN، يمكن البحث عن الرسالة في مقالة حلّ المشاكل الشائعة في عملية الإعداد للحصول على شرح أكثر تفصيلاً والإجراءات المحتملة التي يمكن اتّخاذها لحلّ المشكلة.

تصحيح أخطاء رسائل تسجيل الأخطاء الشائعة

في الإصدار 23.5.0 من حزمة "SDK لإعلانات Google على الأجهزة الجوّالة"، تم تحسين التسجيل التفصيلي لتسجيل تتبُّع تسلسل استدعاء الدوال البرمجية للمكان الذي يتعذّر فيه تحميل الإعلان. لا تشير هذه الرسائل إلى حدوث تعذّر، بل تحدّد المصدر الفريد للخطأ. يقدّم الجدول التالي سجلات الأخطاء الشائعة والأوصاف والإجراءات المقترَحة لحلّها:

سجلّ الأخطاء الوصف الإجراءات المقترَحة
com.google.android.gms.ads.nonagon.render.cp: * لم يعرض خادم الإعلانات إعلانًا أو أيّ مصادر إعلانات توسّط لطلب العميل. لمعرفة تفاصيل المشاكل الشائعة في ما يتعلّق بالخطوات الإرشادية من هذا النوع، يُرجى الاطّلاع على حلّ المشاكل الشائعة في ما يتعلّق بالخطوات الإرشادية.
com.google.android.gms.ads.nonagon.render.e: * تعذّر تحميل جميع مصادر الإعلانات في تدفق التوسّط. يمثّل الخطأ المحدّد آخر مصدر إعلان تعذّر عليه إكمال العملية. لمعرفة التفاصيل حول تسجيل سبب تعذُّر كلّ مصدر إعلان توسّط، يُرجى الاطّلاع على معلومات عن الردّ.
com.google.android.gms.ads.internal.util.*: Unable to obtain a JavascriptEngine. تعذّر إرسال طلب الإعلان لأنّ WebView ليس مسموحًا به في العمليات المميّزة.
  • تحقّق من إعدادات الإنترنت.
  • أزِل android:sharedUserId="android.uid.system" وثبِّت التطبيق كتطبيق نظام.
تعذّر عرض الإعلان بسبب بطء الاتصال بالشبكة. حاوِل تحسين سرعة اتصالك بالإنترنت ثم أعِد المحاولة.
com.google.android.gms.ads.nonagon.load.a انتهت مهلة طلب الإعلان.
com.google.android.gms.ads.internal.util.*: Error while connecting to ad server: Unable to resolve host "pubads.g.doubleclick.net": No address associated with hostname تعذّر عرض الإعلان بسبب عدم توفّر اتصال بالشبكة.
com.google.android.gms.ads.internal.util.*: Error building request URL: Cannot determine request type. Is your ad unit id correct? لم يتطابق رقم تعريف الوحدة الإعلانية مع تعبير عادي متوقّع. تأكَّد من صحة رقم تعريف الوحدة الإعلانية.
com.google.android.gms.ads.internal.render.bt: Unable to instantiate mediation adapter class. لا يمكن لحزمة SDK لإعلانات Google على الأجهزة الجوّالة العثور على محوِّل التوسّط.
  • يمكنك تشخيص المحوِّلات التي لا يمكن لحزمة SDK لإعلانات Google على الأجهزة الجوّالة العثور عليها باستخدام عرض المحوِّلات المتاحة في "أداة فحص الإعلانات".
  • أضِف المحوِّلات غير المتوفّرة إلى مشروعك. للاطّلاع على تعليمات حول كيفية إكمال هذه الخطوة لكلّ مصدر إعلاني، يُرجى الاطّلاع على تفاصيل الشبكة.
com.google.android.gms.internal.ads.*: Received error HTTP response code: 403 رفضت خوادم AdMob الطلب. يُرجى إعادة المحاولة لاحقًا. إذا كان بالإمكان تكرار المشكلة باستمرار، يمكنك تسجيل عنوان URL للطلب باستخدام أداة فحص الإعلانات والتواصل مع فريق الدعم.