Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalStateException: Only fullscreen activities can request orientation #68

Closed
gchristov opened this issue Nov 1, 2017 · 30 comments
Assignees

Comments

@gchristov
Copy link

Got this error when targeting Android O (API 27).

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.graffitab.dev/com.instabug.library.InstabugFeedbackActivity}: 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)
                                                                       at android.os.Looper.loop(Looper.java:164)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                                       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.instabug.library.util.OrientationUtils.lockScreenOrientation(OrientationUtils.java:72)
                                                                       at com.instabug.library.util.OrientationUtils.handelOrientation(OrientationUtils.java:96)
                                                                       at com.instabug.library.InstabugFeedbackActivity.onCreate(InstabugFeedbackActivity.java:116)

Any ideas on how to resolve?

@ghost ghost self-assigned this Nov 2, 2017
@ghost
Copy link

ghost commented Nov 2, 2017

@8masterofpuppets8 Hey Georgi, would you please tell me which version of the SDK did this happen on?
Also, does this crash happen consistently? Are you able to reproduce it? If, yes, what are your steps, please? :)

@gchristov
Copy link
Author

Hi, yes of course :)

I'm on version 4.3.3 and my app config is:

defaultConfig {
        applicationId "com.graffitab"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode VERSION_CODE
        versionName VERSION_NAME
        multiDexEnabled true
        renderscriptTargetApi 19
        renderscriptSupportModeEnabled true
    }

The code I use for Instabug is:

instabug = new Instabug.Builder(GTApplication.getInstance(), TOKEN)
                .setInvocationEvent(InstabugInvocationEvent.SHAKE)
                .setCrashReportingState(Feature.State.DISABLED) // Disbale crash reporting, as we have Google Analytics.
                .build();
        Instabug.setIntroMessageEnabled(false);
        Instabug.enable();

The I call the SDK like this Instabug.invoke();

This works when I run the app on Android 7 but on Android 8 it fails with the exception above. Let me know if I can help in any other way. I really like the SDK and would like to continue using it :)

@gchristov
Copy link
Author

I can confirm that if I put the targetSdkVersion 26 it works just fine on Android O. Any idea when this will be resolved for API 27?

@gchristov gchristov unassigned ghost Nov 3, 2017
@hanspeide
Copy link

hanspeide commented Nov 8, 2017

@reemalashry1 Any updates here? We're also seeing this issue

@KChernenko
Copy link

Hi, we are seeing this issue on Android 8.1 DP too.

@ZiadAyman
Copy link

We are currently working on a fix for this and I'll make sure to notify you all whenever its done :)

@hanspeide
Copy link

@ZiadAyman So, any updates? It's quite disappointing that a bug that crashes apps is not fixed faster. And this should be an easy fix too, I would guess?

@ZiadAyman
Copy link

Hey @hanspeide
Instabug SDK is built on one Translucent activity. We lock the orientation during of any app during Instabug invocation, the API where using doesn’t support locking the orientation on translucent activities anymore on compileSdkVersion 27. This will require to make a bigger change on the architecture of the SDK and we’re doing our best to make sure that this fix shipped as soon as possible. In the meantime the SDK is working fine on compileSdkVersion 26.

This will be released very soon from our side and I'll make sure to notify you within the coming days :)

@schusss
Copy link

schusss commented Dec 5, 2017

3 weeks later, still the case

@ZiadAyman
Copy link

@schusss We know this is taking time from our side. We are doing our best and the issue will be solved once we release our mobile dev early next week.

I will make sure to notify you once everything is in place :)

@ZiadAyman
Copy link

Hey all!

We released our mobile dev. Please update to our latest android version 4.5.0 where the orientation issue is fixed.

@ZiadAyman ZiadAyman self-assigned this Dec 11, 2017
@gchristov
Copy link
Author

gchristov commented Dec 11, 2017

I can confirm that v4.5.0 works for me with this config:

android {
    compileSdkVersion 27
    buildToolsVersion '26.0.2'

    defaultConfig {
        ...
        minSdkVersion 21
        targetSdkVersion 27
        ...
    }

    ...
}

Thanks guys!

@par128
Copy link

par128 commented Dec 20, 2017

We are using firebase-ads.
Still experiencing this issue.

Our configuration
compileSdkVersion 27
buildToolsVersion "27.0.2"
api 'com.google.firebase:firebase-ads:11.+'

Should we wait for firebase-ads update?
Is there any solution besides downgrading to SDK 26 by now?

@ZiadAyman
Copy link

hey @par128 Can you tell me please what Android SDK version are you using?

@par128
Copy link

par128 commented Dec 21, 2017

Thank you for responding, Ziad.
Android SDK 27

@par128
Copy link

par128 commented Dec 21, 2017

We see that the crash has only happened on one device so far.
Nokia 6 with Android 8.0 on board.

@ZiadAyman
Copy link

I am sorry if you misunderstood my question, I mean instabug's SDK version @par128 Is it 4.5.0 the latest one or you are using an older SDK version?

@par128
Copy link

par128 commented Dec 21, 2017

I'm so sorry.
For some reason I decided that this is AdMob support thread.
We see a similar crash in AdMob Interstitials.
Again, sorry to disturb you.
We do not use Instabug.

@ZiadAyman
Copy link

@par128 Oh okay, no worries :))

@madamvixen
Copy link

On v4.9.0, I am currently getting the same error and app crash while running my app on API 26 AVD. targetSdkVersion is 27 for the application I am working on.

NOTE: Reverting to 4.5.0 or changing the targetSdkVersion to 26 seems to be resolving the issue.

I would assume the latest 4.9.0 would have the changes made in 4.5.0. but I think not (?)

@youyix
Copy link

youyix commented Jul 27, 2018

Hi,
I have same situation on v8.0.3 with targetSdkVersion 27. It always crashes on Android 8.0 (API 26) and works well on others.
Here is the configs:

android {
    compileSdkVersion 27
    defaultConfig {
        ...
        minSdkVersion 23
        targetSdkVersion 27
    }   
}

@chandank109
Copy link

Hello, My app is using
minSdkVersion 16
targetSdkVersion 27

I have used Transparent activity registering it in Manifest with orientation.
When Opening that activity , App crashed saying

java.lang.IllegalStateException: Only fullscreen activities can request orientation

It only happens on Android 8.0.

@AlpeshSorathiya
Copy link

Set Orientation of activity in Manifiest.xml
android:screenOrientation="unspecified"

@hamzaahmedkhan
Copy link

 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
	

	// fixing portrait mode problem for SDK 26 if using windowIsTranslucent = true
    if (Build.VERSION.SDK_INT == 26) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
    } else {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    }        
}



   <style name="SplashActivty" parent="AppTheme">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowNoTitle">true</item>
</style>

@Darioszka
Copy link

Where I must use this override?

@mzelzoghbi
Copy link
Contributor

Hey @Darioszka,
Can I know which Instabug SDK version is causing the issue?

@mzelzoghbi mzelzoghbi assigned mzelzoghbi and unassigned ZiadAyman Jan 9, 2019
@Darioszka
Copy link

Darioszka commented Jan 9, 2019

Crashes on Oreo: Only fullscreen activities can request orientation

My Manifest is very simple:
`

-

`

@mzelzoghbi
Copy link
Contributor

@Darioszka
Ok, but I mean Instabug SDK Version that you are using in your application

@Darioszka
Copy link

Im using Unity and I have installed API 28 on Android Studio

@mzelzoghbi
Copy link
Contributor

@Darioszka This doesn’t seem related to the Instabug SDK. If it is, please open a new issue on our Unity SDK repo at https://github.com/Instabug/unity

@Instabug Instabug locked as off-topic and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests