Unable to start activity ComponentInfo{com.myapp/com.google.android.gms.ads.AdActivity}: java.lang.IllegalStateException: Only fullscreen activities can request orientation
com.google.android.gms:play-services-ads:11.8.0
Thanks
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
tools:replace="android:theme"
/>
Because of this commit i am not able to use full screen ads on device running 27 ( O ).supportLibraryVersion = '27.0.1'
playServicesVersion = '11.6.0'
classpath 'com.google.gms:google-services:4.1.0'
And my App level gradle
compileSdkVersion 28
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.android.ads.consent:consent-library:1.0.6'
implementation 'com.google.firebase:firebase-core:16.0.3'
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/afe7c60c-dd8c-4a71-ba60-2d0a5bcc693f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
8.0.0 OS Version | |
Portrait UI Orientation |
FIG-LX3 Device | |
Portrait Orientation | |
On Proximity |
SM-A720F Device | |
Portrait Orientation | |
On Proximity Operating System |
8.0.0 OS Version | |
Portrait UI Orientation | |
No Rooted |
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hyperionics.avar/com.google.android.gms.ads.AdActivity}: java.lang.IllegalStateException: Only fullscreen activities can request orientation at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) |
at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) |
at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) etc. etc. etc. - dozens and dozens of these and similar. Greg |
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/b5158bbd-8df6-4a24-8077-0da935a88e14%40googlegroups.com.
Hello Deepika,I don't have a device where this bug happens, actually don't have any real device with Android 8, only emulators. Tried to reproduce it under an emulator, but could not. Also no user has contacted me directly about this issue, I only see dozens of crashes on Fabric Crashlytics.I'm not sure if you have seen my latest email to Matthew, so I'm pasting a fragment about a work-around that I found on StackOverflow, that fixes the issue for me (no more of these crashes reported on Crashlytics after implementing and releasing this workaround). Please read the quoted StackOverflow article too, it may give you additional hints on where to look for the root of the problem.For the most common crash "IllegalStateException: Only fullscreen activities can request orientation" - they were happening mostly on Android 8, AdMob ads services ver. 17.1.0, Android compileSdkVersion and target SDK version 28. I found a work-around for them on StackOverflow. Here is what I did:In AndroidManifest.xml declared:<!--
Supposed workaround for AdMob SDK crash
IllegalStateException: Only fullscreen activities can request orientation
-->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:theme="@style/TranslucentTheme"
tools:replace="android:theme"
/>
Plus in values/styles.xml:<!--
Supposed workaround for AdMob SDK crash
IllegalStateException: Only fullscreen activities can request orientation
-->
<style name="TranslucentTheme" 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>So far this workaround works fine, did not see these crashes anymore. It should be still fixed or work-around implemented directly in AdMob SDK to avoid problems for other and future users.Greg
<!--
Supposed workaround for AdMob SDK crash
IllegalStateException: Only fullscreen activities can request orientation
-->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:theme="@style/TranslucentTheme"
tools:replace="android:theme"
/>
<!--
Supposed workaround for AdMob SDK crash
IllegalStateException: Only fullscreen activities can request orientation
-->
<style name="TranslucentTheme" 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>
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
--
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/8zPchu8c0Ko/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/88f523df-1f50-431c-91ec-dd23577aa1f2%40googlegroups.com.
FATAL EXCEPTION: ControllerMessenger Process: xxx, PID: 10128 java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx/com.google.android.gms.ads.AdActivity}: java.lang.IllegalStateException: Only fullscreen activities can request orientation at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) at android.os.Handler.dispatchMessage(Handler.java:105)
--
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/8zPchu8c0Ko/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/186vp180000000000g8ave006dhp5ay64mjadpg74o30c1g64sjie1g%40mail.gmail.com.
Hi,How it can be fixed when there is no new release? The latest version (Firebase ads 17.1.2) was released on last December and we keep receiving these crashes and waiting for a new version that hopefully will fix it.Greetings,Yan
On Thu, Feb 14, 2019, 21:01 mobileadssdk-forumadvisor via Google Mobile Ads SDK Developers <google-admob-ads-sdk@googlegroups.com wrote:
--Hello,Our team has fixed this issue. Could you please confirm if you're still seeing these crashes on the latest version of the SDK?Thanks,Bharani CherukuriMobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
http://googleadsdeveloper.blogspot.com
https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/8zPchu8c0Ko/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
Because of this commit i am not able to use full screen ads on device running 27 ( O ).
supportLibraryVersion = '27.0.1'
playServicesVersion = '11.6.0'
E/UncaughtException: java.lang.RuntimeException: Unable to start activity ComponentInfo{(my.package)/com.google.android.gms.ads.AdActivity}: java.lang.IllegalStateException: Only fullscreen activities can request orientationat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3046)at android.app.ActivityThread.-wrap11(Unknown Source:0)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1688)at android.os.Handler.dispatchMessage(Handler.java:105)at android.os.Looper.loop(Looper.java:164)at android.app.ActivityThread.main(ActivityThread.java:6809)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:5918)at android.app.Activity.setRequestedOrientation(Activity.java:5762)at com.google.android.gms.ads.internal.overlay.d.a(:com.google.android.gms.DynamiteModulesA@11746440:182)at com.google.android.gms.ads.internal.overlay.d.b(:com.google.android.gms.DynamiteModulesA@11746440:216)at com.google.android.gms.ads.internal.overlay.d.a(:com.google.android.gms.DynamiteModulesA@11746440:76)at com.google.android.gms.ads.internal.overlay.client.c.onTransact(:com.google.android.gms.DynamiteModulesA@11746440:8)at android.os.Binder.transact(Binder.java:622)at com.google.android.gms.internal.zzed.zzb(Unknown Source:7)
at com.google.android.gms.internal.zzwl.onCreate(Unknown Source:8)at com.google.android.gms.ads.AdActivity.onCreate(Unknown Source:29)
at android.app.Activity.performCreate(Activity.java:6998)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1230)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2899)