Объявление показывается, но когда я нажимаю close the ad
, появляется ошибка:
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.
И действия не выполняются в onRewardedAdClosed()
Шаги:
При запуске я выполняю:
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
Log.d(TAG, "onInitializationComplete: " + initializationStatus);
}
});
Далее:
rewardedAd = new RewardedAd(this, "ca-app-pub-3940256099942544/5224354917");
Далее:
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);
Проверка реального мобильного телефона: Android 6.0, Huawei p8 Lite
implementation 'com.google.android.gms:play-services-ads:18.2.0'
Пытался понизить рейтинг com.google.android.gms: play-services-ads
, но он не работает
В чем проблема?
Изменения
Журнал:
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