title: Interstitial Admob ads: "IllegalStateException: Only fullscreen activities can request orientation"
body: <h2>Background</h2>
  
  <p>I have an app with Admob SDK used in it, to show Interstitial ads (full screen ads).</p>
  
  <p>Reccently Google has updated the SDK, along with many other things (build tools, gradle plugin, IDE, etc...), including admob (firebase ads).</p>
  
  <pre><code>compile 'com.google.firebase:firebase-ads:11.4.2'
  </code></pre>
  
  <h2>The problem</h2>
  
  <p>After updating, I noticed that whenever the app tries to show an Interstitial ad, it crashes.</p>
  
  <p>The crash log is as such:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Thing is that it worked fine before. Now I'm not sure what causes it to occur.</p>
  
  <p>Searching the web, I didn't see anything that talks about "Only fullscreen activities can request orientation" . </p>
  
  <p>What I had in the manifest, is something a bit old, that might not be needed anymore:</p>
  
  <pre><code>    &lt;activity
          android:name="com.google.android.gms.ads.AdActivity"
          android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
          android:theme="@android:style/Theme.Translucent"/&gt;
  </code></pre>
  
  <p>I say it's probably not needed, because i can't see it anymore in the tutorials, even though I remember I did in the past:</p>
  
  <ul>
  <li><a href="https://developers.google.com/admob/android/quick-start" rel="noreferrer">https://developers.google.com/admob/android/quick-start</a></li>
  <li><a href="https://developers.google.com/admob/android/interstitial" rel="noreferrer">https://developers.google.com/admob/android/interstitial</a></li>
  </ul>
  
  <h2>What I've tried</h2>
  
  <ol>
  <li><p>I tried to remove the manifest entry. Still same issue.</p></li>
  <li><p>I tried to set the theme to be "@android:style/Theme.Translucent.NoTitleBar.Fullscreen" by force, but it also didn't help.</p></li>
  <li><p>I even thought that it might be because I currently have Android 8.1, but when I tried using the app from the play store, I noticed it worked just fine, without crashes.</p></li>
  <li><p>I tried to go back to as far as version 11.2.2 of admob and use gradle v 2.3.3 , but it also didn't help.</p></li>
  <li><p>When trying on an emulator with Android 7.0 , it worked fine with latest versions of everything, and removal of the whole manifest activity tag.</p></li>
  <li><p>I tried to use this in gradle file, instead of what I used :</p>
  
  <p>compile 'com.google.android.gms:play-services-ads:11.4.2' </p></li>
  </ol>
  
  <p>Still crashed on my device (Nexus 5x with Android 8.1) yet didn't crash on emulator.</p>
  
  <ol start="7">
  <li><p>Finally, I tried to run the app on emulator with Android 8.1, and it crashed just as on the real device. </p></li>
  <li><p>Reported about this to Google Admob team, as well as <a href="https://issuetracker.google.com/issues/68427483" rel="noreferrer"><strong>Android issue tracker</strong></a>. I hope they will answer me about this.</p></li>
  </ol>
  
  <h2>The questions</h2>
  
  <p>What could be the cause to this issue?</p>
  
  <p>Is it because of Android 8.1 ? If so, how come the older version of the app worked fine? I tried to revert there a lot of versions to old ones, yet it still crashed.</p>
  
  <p>And, most importantly, how can I solve it?</p>