for (AdProvider adProvider: ConsentInformation.getInstance(MainActivity.this).getAdProviders()) {
...
}
Exception:
Fatal Exception: java.lang.ClassCastException: com.google.gson.t.g cannot be cast to com.google.ads.consent.AdProvider
at com.example.myapp.Activities.MainActivity.showConsentDialog(MainActivity.java:271)
at com.example.myapp.Activities.MainActivity$1.onConsentInfoUpdated(MainActivity.java:188)
at com.google.ads.consent.ConsentInformation$ConsentInfoUpdateTask.onPostExecute(ConsentInformation.java:277)
at com.google.ads.consent.ConsentInformation$ConsentInfoUpdateTask.onPostExecute(ConsentInformation.java:188)
at android.os.AsyncTask.finish(AsyncTask.java)
at android.os.AsyncTask.access$500(AsyncTask.java)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java)
at android.os.Handler.dispatchMessage(Handler.java)
at android.os.Looper.loop(Looper.java)
at android.app.ActivityThread.main(ActivityThread.java)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
The code works on majority of devices. This crash occurs on following devices:
Hi, In my app, this line throws an Exception:
Exception:
The code works on majority of devices. This crash occurs on following devices:
OS Android 4.2.2, 5.1.1