我实现了AdConsent库,并收到了Crashlytics通知
致命异常:java.lang.IllegalArgumentException参数 指定为非null为null:方法e.c.b.d.b,参数 错误说明 package_id.MainActivity $ checkForAdConsent $ 1.onConsentInfoUpdated
堆栈跟踪:
package_id.MainActivity$checkForAdConsentMethod$1.onConsentInfoUpdated (Unknown Source)
com.google.ads.consent.ConsentInformation$ConsentInfoUpdateTask.onPostExecute (Unknown Source:42)
com.google.ads.consent.ConsentInformation$ConsentInfoUpdateTask.onPostExecute (Unknown Source:1)
android.os.AsyncTask.finish (AsyncTask.java:636)
android.os.AsyncTask.access$500 (AsyncTask.java:177)
android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:653)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:135)
android.app.ActivityThread.main (ActivityThread.java:5254)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:903)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:698)
首先,应该在Firebase Crashlytics控制台中对Crashlytics报表进行模糊处理,但我不明白为什么我应该有这样的内容
方法e.c.b.d.b
在我的报告中。
我对CheckForAdConsent的实现:
private fun checkForAdConsent() {
val consentInformation = ConsentInformation.getInstance(this)
val publisherIds = Array(1, { "admob-pub-id" })
consentInformation.requestConsentInfoUpdate(publisherIds, object : ConsentInfoUpdateListener {
override fun onConsentInfoUpdated(consentStatus: ConsentStatus) {
when (consentStatus) {
ConsentStatus.NON_PERSONALIZED -> loadAds(false)
ConsentStatus.PERSONALIZED -> loadAds(true)
ConsentStatus.UNKNOWN -> runOnUiThread() { displayConsentForm() }
}
Log.d(TAG, "onConsentInfoUpdated, Consent Status = ${consentStatus.name}")
}
override fun onFailedToUpdateConsentInfo(errorDescription: String) {
Log.d(TAG, "onFailedToUpdateConsentInfo - $errorDescription")
}
})
}
错误发生在android 5.1-4.1.2