Giter Site home page Giter Site logo

Comments (13)

afollestad avatar afollestad commented on May 18, 2024 1

I think the fix to #13 should fix this as well, let me know if not (release coming soon)

from assent.

afollestad avatar afollestad commented on May 18, 2024

Huh, I'm having trouble reproducing this on my Pixel 3 with Android Q

from assent.

CarsonRedeye avatar CarsonRedeye commented on May 18, 2024

I'm also getting this crash. When I run runWithPermissions from a Fragment inside a Fragment pager adapter

from assent.

CarsonRedeye avatar CarsonRedeye commented on May 18, 2024

On further investigation it only happens when I upgrade to navigation components 2.1.0-alpha02. This uses the androidx fragments which must cause this bug

from assent.

afollestad avatar afollestad commented on May 18, 2024

I use AndroidX Fragments and have not observed any problems.

from assent.

CarsonRedeye avatar CarsonRedeye commented on May 18, 2024

Which version? Navigation components currently only depends on androidx.fragment:fragment:1.1.0-alpha05 maybe they fixed it in alpha06 or 07. Could you test with alpha05?

from assent.

CarsonRedeye avatar CarsonRedeye commented on May 18, 2024

To further clarify, Navigation version 1.0.0 works, but Navigation 2.1.0-alpha02 doesn't

from assent.

afollestad avatar afollestad commented on May 18, 2024

I meant specifically indidual AndroidX Fragments (androidx.app.Fragment), not the dependency there or anything navigation related.

from assent.

CarsonRedeye avatar CarsonRedeye commented on May 18, 2024

Sorry if I wasn't clear. I'm talking about the androidx.app.Fragment also. It has different versions released via jetpack now. I only mentioned Navigation because it internally depends on different versions of fragment. I've narrowed the crash down to happening if you depend on "androidx.fragment:fragment:1.1.0-alpha05" (or alpha06 or alpha07) but it doesn't happen if you depend on implementation "androidx.fragment:fragment:1.1.0-alpha04".

from assent.

CarsonRedeye avatar CarsonRedeye commented on May 18, 2024

Does any of this sounds suspiscious ? https://developer.android.com/jetpack/androidx/releases/fragment#1.1.0-alpha05

from assent.

CarsonRedeye avatar CarsonRedeye commented on May 18, 2024

So the crash is obviously related to the change in fragment alpha05 in the above link.
"Calling remove(), hide(), show(), detach(), and setPrimaryNavigationFragment() with a Fragment attached to a different FragmentManager now throws an IllegalStateException rather than silently failing (aosp/904301)"
I had a look at your code to see if I could make a PR but couldn't see the solution. Looking forward to a fix. Cheers

from assent.

guger avatar guger commented on May 18, 2024

I'm getting the same error when calling it from within a DialogFragment.

java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=65596, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {at.guger.moneybook.dev/at.guger.moneybook.ui.activity.MainActivity}: java.lang.IllegalStateException: Cannot detach Fragment attached to a different FragmentManager. Fragment PermissionFragment{e597fd5 (a8933ae6-618e-41cd-be92-64617c72530a) [assent_permission_fragment/fragment]} is already attached to a FragmentManager.

I'm using AndroidX libraries:
Navigation: 2.1.0-alpha03
Fragment: 1.1.0-alpha08

from assent.

CarsonRedeye avatar CarsonRedeye commented on May 18, 2024

Yeah works for me!

from assent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.