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

When this library is applied to Fragment and run on Android 8.0, "System UI has stopped" is displayed. #654

Open
kwmt opened this issue Dec 28, 2019 · 6 comments
Assignees
Labels

Comments

@kwmt
Copy link

kwmt commented Dec 28, 2019

FAQs


Overview

  • When this library is applied to Fragment and run on Android 8.0, "System UI has stopped" is displayed.

Expected

  • Works on Android 8.0

Actual

  • Doesn’t work on Android 8.0.

Environment

Reproducible steps

  1. Ready on Android8.0 device ( What I saw was an emulator.)
  2. Run the following branch.
    https://github.com/kwmt/PermissionsDispatcher/tree/system-stop-on-fragment

This is a difference.
kwmt#1

@hotchemi
Copy link
Member

hotchemi commented Jan 5, 2020

Thx! In summary in Android 8.0 Fragment#requestPermissions has a bug and causes a crash? 👀 Let us check anyway 🙇

@hotchemi hotchemi self-assigned this Jan 6, 2020
@hotchemi
Copy link
Member

hotchemi commented Jan 6, 2020

I've tried kwmt#1 with 8.0.0 emulator but somehow couldn't see the error. Could we get more detail or error message if possible? 🙇 @kwmt

@kwmt
Copy link
Author

kwmt commented Jan 8, 2020

Hi, @hotchemi
Thank you for trying. It's a mystery 🤔

  • The emulator I confirmed this problem is following image:
    image
  • As you can see, no error log.
    all_crash

I hope this will help.

@hotchemi
Copy link
Member

hotchemi commented Jan 8, 2020

umm, thx let us check again! 🙇

@0xByteLeon
Copy link

@hotchemi

In PermissionsRequestFragment onAttach Method
activity?.requestedOrientation = if (context.resources.configuration.orientation == ORIENTATION_PORTRAIT) ActivityInfo.SCREEN_ORIENTATION_PORTRAIT else ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE

Android8.0 can't set orientation sometime ,Please fix this bug

Caused by: java.lang.IllegalStateException: Only fullscreen activities can request orientation
at android.os.Parcel.readException(Parcel.java:1959)
at android.os.Parcel.readException(Parcel.java:1897)
at android.app.IActivityManager$Stub$Proxy.setRequestedOrientation(IActivityManager.java:5760)
at android.app.Activity.setRequestedOrientation(Activity.java:5793)
at permissions.dispatcher.ktx.PermissionsRequestFragment.onAttach(PermissionsRequestFragment.kt:26)
at androidx.fragment.app.Fragment.performAttach(Fragment.java:2672)
at androidx.fragment.app.FragmentStateManager.attach(FragmentStateManager.java:263)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1170)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2169)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1992)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1947)
at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1818)
at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:303)
at permissions.dispatcher.ktx.PermissionRequestType.requestPermissions$ktx_release(PermissionRequestType.kt:80)

@Moster1h
Copy link

I also encountered this problem, and the version used was 4.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants