The ad is showing, but when I click on close the ad the error is:
W/Ads: #004 The webview is destroyed. Ignoring action.
W/Ads: #004 The webview is destroyed. Ignoring action.
W/Ads: #004 The webview is destroyed. Ignoring action.
#004 The webview is destroyed. Ignoring action.
And actions don't perform in onRewardedAdClosed()
Steps:
When starting, I execute:
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
Log.d(TAG, "onInitializationComplete: " + initializationStatus);
}
});
Next:
rewardedAd = new RewardedAd(this, "ca-app-pub-3940256099942544/5224354917");
Next:
RewardedAdCallback adCallback = new RewardedAdCallback() {
@Override
public void onRewardedAdOpened() {
// Ad opened.
}
@Override
public void onRewardedAdClosed() {
// Ad closed.
Log.d(TAG, "onRewardedAdClosed: ");
fragmentFirst = new FragmentFirst();
clipBody = getSupportFragmentManager();
FragmentTransaction clipUnit = clipBody.beginTransaction();
clipUnit.add(R.id.container, fragmentFirst, "fragment_first");
clipUnit.addToBackStack(null);
clipUnit.setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
clipUnit.commit();
}
@Override
public void onUserEarnedReward(@NonNull RewardItem reward) {
// User earned reward.
// Load Tasks
Log.d(TAG, "onUserEarnedReward: ");
// coins++
}
@Override
public void onRewardedAdFailedToShow(int errorCode) {
// Ad failed to display
}
};
rewardedAd.show(MainActivity.this, adCallback);
Test real mobile: Android 6.0, Huawei p8 Lite
implementation 'com.google.android.gms:play-services-ads:18.2.0'
Tried to downgrade com.google.android.gms: play-services-ads, but it doesn't work
What is the problem?
Edits
Log:
E/Ads: Google Mobile Ads SDK initialization functionality unavailable for this session. Ad requests can be made at any time.
E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
E/chromium: [ERROR:gl_surface_egl.cc(222)] eglChooseConfig failed with error EGL_BAD_ATTRIBUTE
E/Ads: Invalid event ID: null
java.lang.NumberFormatException: null