Instabug / Instabug-Android

In-app feedback and bug reporting tool for apps.
https://instabug.com/
Other
188 stars 38 forks source link

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

Closed gchristov closed 6 years ago

gchristov commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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?

hanspeide commented 6 years ago

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

KChernenko commented 6 years ago

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

ZiadAyman commented 6 years ago

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

hanspeide commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

3 weeks later, still the case

ZiadAyman commented 6 years ago

@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 commented 6 years ago

Hey all!

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

gchristov commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

par128 commented 6 years ago

Thank you for responding, Ziad. Android SDK 27

par128 commented 6 years ago

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

ZiadAyman commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

@par128 Oh okay, no worries :))

madamvixen commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

hamzaahmedkhan commented 6 years ago
 @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 commented 5 years ago

Where I must use this override?

mzelzoghbi commented 5 years ago

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

Darioszka commented 5 years ago

Crashes on Oreo: Only fullscreen activities can request orientation

My Manifest is very simple: `<?xml version="1.0" encoding="UTF-8"?>

-

`

mzelzoghbi commented 5 years ago

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

Darioszka commented 5 years ago

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

mzelzoghbi commented 5 years ago

@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