ข้อผิดพลาดในการโหลดโฆษณา

ในกรณีที่โหลดโฆษณาไม่สำเร็จ ระบบจะเรียกใช้ Callback ซึ่งจะแสดงออบเจ็กต์ 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/admob/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/admob/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 คุณสามารถค้นหาข้อความ ได้ใน บทความแก้ไขปัญหาการเริ่มต้นใช้งานที่พบบ่อย เพื่อดูคำอธิบายโดยละเอียดเพิ่มเติมและการดำเนินการที่เป็นไปได้ เพื่อแก้ไขปัญหา

แก้ไขข้อความบันทึกข้อผิดพลาดที่พบบ่อย

ใน Google Mobile Ads SDK เวอร์ชัน 23.5.0 เราได้ปรับปรุงการบันทึกแบบละเอียดเพื่อ รวม Stack Trace ของตำแหน่งที่โฆษณาโหลดไม่สำเร็จ ข้อความเหล่านี้ไม่ได้ บ่งบอกถึงการขัดข้อง แต่จะระบุแหล่งที่มาของข้อผิดพลาดที่ไม่ซ้ำกัน ตารางต่อไปนี้แสดงบันทึกข้อผิดพลาดที่พบบ่อย คําอธิบาย และการดําเนินการที่แนะนํา เพื่อแก้ไข

บันทึกข้อผิดพลาด คำอธิบาย การดำเนินการที่แนะนำ
com.google.android.gms.ads.nonagon.render.cp: * เซิร์ฟเวอร์โฆษณาไม่ได้แสดงโฆษณาหรือแหล่งที่มาของโฆษณาสื่อกลางใดๆ ตามคำขอ ดูรายละเอียดเกี่ยวกับปัญหาที่พบบ่อย เกี่ยวกับการเริ่มต้นใช้งานประเภทนี้ได้ที่แก้ไขปัญหาที่พบบ่อยเกี่ยวกับการเริ่มต้นใช้งาน
com.google.android.gms.ads.nonagon.render.e: * โหลดแหล่งที่มาของโฆษณาทั้งหมดใน Waterfall ของสื่อกลางไม่สำเร็จ ข้อผิดพลาดที่เฉพาะเจาะจง แสดงถึงแหล่งที่มาของโฆษณาสุดท้ายที่ไม่สำเร็จ ดูรายละเอียดเกี่ยวกับการบันทึกเหตุผลที่แหล่งที่มาของโฆษณาในการไกล่เกลี่ยแต่ละรายการไม่สำเร็จได้ที่ ข้อมูลการตอบกลับ
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 ของคำขอ โดยใช้เครื่องมือตรวจสอบโฆษณา และติดต่อทีมสนับสนุน