Fixed
Status Update
Comments
ma...@gmail.com <ma...@gmail.com> #2
Same problem here WTF they have done? I have published update and now I have to revert immediately otherwise my App is fucked!
lb...@gmail.com <lb...@gmail.com> #3
@2 The weird thing is that I can see it only on Android 8.1, and only on a new version of the app. The old one works fine.
I can't find the reason for this.
I can't find the reason for this.
lb...@gmail.com <lb...@gmail.com> #4
@2 I'm really considering leaving Admob. It has issues with orientation change (reloads itself), with performance (on Android O, especially), and now this.
Sadly I don't know of other ad networks that are this easy to use and to manage (has its own app to show how much I earned).
Sadly I don't know of other ad networks that are this easy to use and to manage (has its own app to show how much I earned).
ma...@gmail.com <ma...@gmail.com> #5
See my answer here.
https://stackoverflow.com/questions/46992843/interstitial-admob-ads-illegalstateexception-only-fullscreen-activities-can-r/46995624#46995624
The android fragmented ecosystem is already difficult to handle for developers, if they don't use adequate policies It's an hell.
Admob is developed by Google itself that should test coming SDK update before to make sure everything works when released to public and Google should publish a clear changelog of critical changes without forcing people to read thousands codelines or wait for the next unespected crash.
The android fragmented ecosystem is already difficult to handle for developers, if they don't use adequate policies It's an hell.
Admob is developed by Google itself that should test coming SDK update before to make sure everything works when released to public and Google should publish a clear changelog of critical changes without forcing people to read thousands codelines or wait for the next unespected crash.
lb...@gmail.com <lb...@gmail.com> #6
This is a stupid limitation.
Why would Android require that only full screen activity could change its orientation?
Such a thing should be possible for all types of activities...
Why would Android require that only full screen activity could change its orientation?
Such a thing should be possible for all types of activities...
lb...@gmail.com <lb...@gmail.com> #7
dn...@google.com <dn...@google.com>
dn...@google.com <dn...@google.com> #8
Please share complete application source code/ test apk to test this issue.
lb...@gmail.com <lb...@gmail.com> #9
@8 Attached. Please run on Nexus 5x with Android 8.1.
Also notice a weird issue, that might be related (attached screenshot) : the support library doesn't seem to match with something else the project uses, perhaps from Admob.
Also notice a weird issue, that might be related (attached screenshot) : the support library doesn't seem to match with something else the project uses, perhaps from Admob.
dn...@google.com <dn...@google.com> #10
Our engineering team has fixed this issue. It will be available in a future Android release, so please keep an eye on the release notes.
lb...@gmail.com <lb...@gmail.com> #11
@10 What was the issue exactly? Is there a need of a fix on Admob too?
mi...@gmail.com <mi...@gmail.com> #12
same problem here please resolve this :|
h....@gmail.com <h....@gmail.com> #13
This is unclear. Can we expect interstitial ads to work with TargetSDK 27 at some point or is it doomed forever?
pr...@gmail.com <pr...@gmail.com> #14
This issue is still happening and affecting our business. Any updates on fix in Admob? Or is it fixed in Android API (version?) only?
[Deleted User] <[Deleted User]> #15
Fixed WTF? Don't mark this as fixed if the solution isn't published yet. At this date, the apps continue crashing for this reason. Please, take this seriously
fl...@gmail.com <fl...@gmail.com> #16
This problem is happening to my apps. Any solution?
si...@gmail.com <si...@gmail.com> #17
So has anyone figured out a way to prevent this? I need to ship something with TargetSDK 27 and would prefer not having to code a workaround that prevents interstitial ads on all Android 8.1 devices ...
lb...@gmail.com <lb...@gmail.com> #18
@17 Why do you need to have targetSdk 27?
You can just have compileSdkVersion 27 instead, and use all that it offers there.
You can just have compileSdkVersion 27 instead, and use all that it offers there.
si...@gmail.com <si...@gmail.com> #19
It was recommended to us by Google to target the latest SDK in order to inform devices not to enable any compatibility behaviors to maintain my app's forward-compatibility. Let's just say I don't have much of a choice.
mn...@gmail.com <mn...@gmail.com> #20
For me the problem appears only on Android 8.0, but not on 8.1
However, i have managed to fix it by changing the ad activity's theme from android:theme="@android:style/Theme.Translucent" to android:theme="@android:style/Theme.NoTitleBar.Fullscreen" in the manifest. Also you may need to add tools:replace="android:theme"
However, i have managed to fix it by changing the ad activity's theme from android:theme="@android:style/Theme.Translucent" to android:theme="@android:style/Theme.NoTitleBar.Fullscreen" in the manifest. Also you may need to add tools:replace="android:theme"
si...@gmail.com <si...@gmail.com> #21
@20 thanks for your comment, this is a good workaround and I'm not crashing anymore on my 8.0 phone.
I had to edit "play-services-ads-lite-11.6.2.aar" since it contains an AndroidManifest.xml with "Theme.Translicent". For those trying to achieve this, check outhttps://stackoverflow.com/questions/38860912/modifying-contents-of-android-aar-file-converting-to-and-from-zip-format
I had to edit "play-services-ads-lite-11.6.2.aar" since it contains an AndroidManifest.xml with "Theme.Translicent". For those trying to achieve this, check out
tu...@gmail.com <tu...@gmail.com> #22
Add in your Manifest
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
tools:replace="android:theme"/>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
tools:replace="android:theme"/>
gr...@gmail.com <gr...@gmail.com> #23
@22 interesting solution, but unfortunately it does only the half job.
When you set the AdActivity to FullScreen, then you'll no longer get video ads served.
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
tools:replace="android:theme"/>
After setting the AdActivity that way, only regular (non-video) interstitials are served.
Please correct me when I'm wrong.
Please Google, give us a real fix. That cannot be that hard.
When you set the AdActivity to FullScreen, then you'll no longer get video ads served.
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
tools:replace="android:theme"/>
After setting the AdActivity that way, only regular (non-video) interstitials are served.
Please correct me when I'm wrong.
Please Google, give us a real fix. That cannot be that hard.
gr...@gmail.com <gr...@gmail.com> #24
@22 Sorry, I was wrong, it had something to do with the emulator that I have used for the tests.
On a real device, the workaround does the job.
Thanks a lot for posting it.
On a real device, the workaround does the job.
Thanks a lot for posting it.
lb...@gmail.com <lb...@gmail.com> #25
@24 So it works well ? Even on Android 8.0 ? And including videos?
gr...@gmail.com <gr...@gmail.com> #26
@25 Yes, targetSdk=27, AdActivity manually set with android:theme="@android:style/Theme.NoTitleBar.Fullscreen" tools:replace="android:theme" works including video ads.
ra...@gmail.com <ra...@gmail.com> #27
@22, @25
Changing the Manifest to:
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
tools:replace="android:theme"/>
will work but will give the following hint in the log:
I/Ads: Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad.
Probably not all problems are solved?
Changing the Manifest to:
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
tools:replace="android:theme"/>
will work but will give the following hint in the log:
I/Ads: Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad.
Probably not all problems are solved?
lb...@gmail.com <lb...@gmail.com> #28
@27 What is the original theme of it? And how to check it?
lb...@gmail.com <lb...@gmail.com> #29
@27 Maybe we can use our own theme, that includes some safe to use values. Here's the one of Theme.Translucent :
<style name="Theme.Translucent">
<item name="windowBackground">@color/transparent</item>
<item name="colorBackgroundCacheHint">@null</item>
<item name="windowIsTranslucent">true</item>
<!-- Note that we use the base animation style here (that is no
animations) because we really have no idea how this kind of
activity will be used. -->
<item name="windowAnimationStyle">@style/Animation</item>
</style>
and the one of Theme.NoTitleBar.Fullscreen:
<style name="Theme.NoTitleBar.Fullscreen">
<item name="windowFullscreen">true</item>
<item name="windowContentOverlay">@null</item>
</style>
<style name="Theme.Translucent">
<item name="windowBackground">@color/transparent</item>
<item name="colorBackgroundCacheHint">@null</item>
<item name="windowIsTranslucent">true</item>
<!-- Note that we use the base animation style here (that is no
animations) because we really have no idea how this kind of
activity will be used. -->
<item name="windowAnimationStyle">@style/Animation</item>
</style>
and the one of Theme.NoTitleBar.Fullscreen:
<style name="Theme.NoTitleBar.Fullscreen">
<item name="windowFullscreen">true</item>
<item name="windowContentOverlay">@null</item>
</style>
gr...@gmail.com <gr...@gmail.com> #30
@27
Yes, you're right. There might be some ads that are not possible to show that way.
But bottom line, it's just an info log, and it works, it does not crash on Android 8.0, and it serves all kind of ads in my case (image ads, text ads, video ads, and even playable ads like game demos).
At the end it's more important to us to get the best app performance as well as to target the latest OS.
I'm pretty sure google will fix that sooner or later, at least I hope so. Until then, the workaround is the best I can see for now.
ra...@gmail.com <ra...@gmail.com> #31
I did a quick test. I combined all the attribute from Theme.Translucent into Theme.NoTitleBar.Fullscreen.
Whenever I add <item name="android:windowIsTranslucent">true</item> in my custom theme the error continue.
So the error is narrowed down to this windowIsTranslucent
My working current theme is
<style name="AppTheme.Translucent" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>
The info log still present though.
Whenever I add <item name="android:windowIsTranslucent">true</item> in my custom theme the error continue.
So the error is narrowed down to this windowIsTranslucent
My working current theme is
<style name="AppTheme.Translucent" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>
The info log still present though.
be...@gmail.com <be...@gmail.com> #32
Styles and themes aren't my speciality - but would it not be possible to use the theme that resolves the crash in:
res/values-v26/styles.xml
And then create a further:
res/values-v27/styles.xml
that uses the standard theme, which avoids I/Ads: Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad.
If someone with more knowledge than I could advise, it would be appreciated.
res/values-v26/styles.xml
And then create a further:
res/values-v27/styles.xml
that uses the standard theme, which avoids I/Ads: Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad.
If someone with more knowledge than I could advise, it would be appreciated.
ps...@gmail.com <ps...@gmail.com> #33
Admob Interstitial ads on Androids 8.0.0 and above will crash with IllegalStateException. Is there any way to fix that? At least a workaround?
Caused by: java.lang.IllegalStateException: Only fullscreen activities can request orientation
at android.os.Parcel.readException(Parcel.java:1950)
at android.os.Parcel.readException(Parcel.java:1888)
at android.app.IActivityManager$Stub$Proxy.setRequestedOrientation(IActivityManager.java:5675)
at android.app.Activity.setRequestedOrientation(Activity.java:5739)
at com.google.android.gms.ads.internal.overlay.d.a(:com.google.android.gms.DynamiteModulesA@11975448:182)
at com.google.android.gms.ads.internal.overlay.d.b(:com.google.android.gms.DynamiteModulesA@11975448:216)
at com.google.android.gms.ads.internal.overlay.d.a(:com.google.android.gms.DynamiteModulesA@11975448:76)
at com.google.android.gms.ads.internal.overlay.client.c.onTransact(:com.google.android.gms.DynamiteModulesA@11975448:8)
at android.os.Binder.transact(Binder.java:604)
at com.google.android.gms.internal.zzeu.zzb(Unknown Source:7)
at com.google.android.gms.internal.zzxg.onCreate(Unknown Source:8)
at com.google.android.gms.ads.AdActivity.onCreate(Unknown Source:29)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2784)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2906)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1605)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:172)
at com.Fisherman.Greekwpa.activities.MainActivity.getScanResults(MainActivity.java:174)
at com.Fisherman.Greekwpa.activities.MainActivity.bridge$lambda$0$MainActivity(Unknown Source:0)
at com.Fisherman.Greekwpa.activities.MainActivity$$Lambda$12.onScanResults(Unknown Source:0)
at com.thanosfisherman.wifiutils.WifiUtils$2.onScanResultsReady(WifiUtils.java:103)
at com.thanosfisherman.wifiutils.wifiScan.WifiScanReceiver.onReceive(WifiScanReceiver.java:20)
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_51117(LoadedApk.java:1290)
at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.$m$0(Unknown Source:4)
at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.run(Unknown Source:0)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:172)
at android.app.ActivityThread.main(ActivityThread.java:6637)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.IllegalStateException: Only fullscreen activities can request orientation
at android.os.Parcel.readException(Parcel.java:1950)
at android.os.Parcel.readException(Parcel.java:1888)
at android.app.IActivityManager$Stub$Proxy.setRequestedOrientation(IActivityManager.java:5675)
at android.app.Activity.setRequestedOrientation(Activity.java:5739)
at com.google.android.gms.ads.internal.overlay.d.a(:com.google.android.gms.DynamiteModulesA@11975448:182)
at com.google.android.gms.ads.internal.overlay.d.b(:com.google.android.gms.DynamiteModulesA@11975448:216)
at com.google.android.gms.ads.internal.overlay.d.a(:com.google.android.gms.DynamiteModulesA@11975448:76)
at com.google.android.gms.ads.internal.overlay.client.c.onTransact(:com.google.android.gms.DynamiteModulesA@11975448:8)
at android.os.Binder.transact(Binder.java:604)
at com.google.android.gms.internal.zzeu.zzb(Unknown Source:7)
at com.google.android.gms.internal.zzxg.onCreate(Unknown Source:8)
at com.google.android.gms.ads.AdActivity.onCreate(Unknown Source:29)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2784)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2906)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1605)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:172)
at com.Fisherman.Greekwpa.activities.MainActivity.getScanResults(MainActivity.java:174)
at com.Fisherman.Greekwpa.activities.MainActivity.bridge$lambda$0$MainActivity(Unknown Source:0)
at com.Fisherman.Greekwpa.activities.MainActivity$$Lambda$12.onScanResults(Unknown Source:0)
at com.thanosfisherman.wifiutils.WifiUtils$2.onScanResultsReady(WifiUtils.java:103)
at com.thanosfisherman.wifiutils.wifiScan.WifiScanReceiver.onReceive(WifiScanReceiver.java:20)
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_51117(LoadedApk.java:1290)
at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.$m$0(Unknown Source:4)
at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.run(Unknown Source:0)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:172)
at android.app.ActivityThread.main(ActivityThread.java:6637)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
lb...@gmail.com <lb...@gmail.com> #34
@33 Please read entire thread. The workaround is to target API 26 instead, or set a special theme to be used there.
di...@gmail.com <di...@gmail.com> #35
Does 12.0.1 fix this issue? I don't see a not in the release notes and don't want to test it on my users.
lb...@gmail.com <lb...@gmail.com> #36
bh...@gmail.com <bh...@gmail.com> #37
Nice Video .Please Check out https://bhuvneshblog.com/how-to-create-admob-account-in-2024
.bhuvneshblog.com is a top notch blog to learn blogging tips, SEO, making money online, affiliate marketing, Wordpress and traffic building tips.
.
Description
- Steps to reproduce the problem (including sample code if appropriate).
Try to use Admob interstitial ads , as shown here:
Here's a snippet of code that worked fine for me for a long time:
MobileAds.initialize(context, context.getString(R.string.admob_app_id));
mInterstitialAd = new InterstitialAd(context);
mInterstitialAd.setAdUnitId(context.getString(R.string.admob_ad_unit_id));
mInterstitialAd.setAdListener(new AdListener() {
...
@Override
public void onAdLoaded() {
super.onAdLoaded();
Log.d("AppLog", "onAdLoaded");
show(context);
}
});
if (!mInterstitialAd.isLoading() && !mInterstitialAd.isLoaded())
mInterstitialAd.loadAd(new AdRequest.Builder().build());
Updated everything you can on the SDK, IDE, etc...
Run the app on Android 7.0 and 8.1.
- What happened.
On version 7.0 (emulator), it worked fine.
On 8.1 (emulator and device), it crashed with this exception:
10-28 14:01:01.394 4523-4523/... I/Ads: Ad opening.
10-28 14:01:01.400 1606-2154/? E/ActivityManager: Activity Manager Crash. UID:10080 PID:4523 TRANS:63
java.lang.IllegalStateException: Only fullscreen activities can request orientation
at com.android.server.am.ActivityRecord.setRequestedOrientation(ActivityRecord.java:2189)
at com.android.server.am.ActivityManagerService.setRequestedOrientation(ActivityManagerService.java:4975)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:1101)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2927)
at android.os.Binder.execTransact(Binder.java:697)
10-28 14:01:01.403 4523-4523/... D/AndroidRuntime: Shutting down VM
10-28 14:01:01.406 4523-4523/... E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{.../com.google.android.gms.ads.AdActivity}: java.lang.IllegalStateException: Only fullscreen activities can request orientation
- What you think the correct behavior should be.
Should work as before.
Since I need an answer of how to solve this, I wrote about it on StackOverflow too:
Please also run "adb bugreport" and archive the output.