Giter Site home page Giter Site logo

Comments (5)

hanibalsk avatar hanibalsk commented on May 6, 2024 2

I had same error today in Craslytics(lg_h815 - Android 6.0):

Fatal Exception: java.lang.RuntimeException
Failure delivering result ResultInfo{who=@android:requestPermissions:, request=42, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {xxx/com.tbruyelle.rxpermissions.ShadowActivity}: java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request.
 Raw
android.app.ActivityThread.deliverResults (ActivityThread.java:3742)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:620)

Caused by java.lang.IllegalStateException
com.tbruyelle.rxpermissions.RxPermissions.onRequestPermissionsResult (RxPermissions.java:286)
com.tbruyelle.rxpermissions.ShadowActivity.onRequestPermissionsResult (ShadowActivity.java:32)
android.app.Activity.dispatchRequestPermissionsResult (Activity.java:6588)
android.app.Activity.dispatchActivityResult (Activity.java:6467)
android.app.ActivityThread.deliverResults (ActivityThread.java:3738)
android.app.ActivityThread.handleSendResult (ActivityThread.java:3785)
android.app.ActivityThread.access$1400 (ActivityThread.java:157)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1405)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5525)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:730)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:620)

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 6, 2024

ok, first you don't need to check the sdk version, it's handled by the library. If Build.VERSION.SDK_INT < 23, the observer will immediately receive a granted result.

Secondly, it seems you're not well informed about runtime permissions. Only a part of the permissions requires a request : the dangerous ones, as Google names them [1].

About the crash itself, I think it's exactly because you request permissions that don't need to be requested. Try to filter the parameter list with only dangerous permissions and it should work.

That said you pointed a weakness in the library that needs a fix. Thanks !

[1] https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 6, 2024

After some tests, there is finally no issue in requesting non-dangerous permissions, but the framework will always answer the permission is not granted. The answer is propagated without change by the library.

Could you tell me if you still have the issue with the last version of RxPermissions ?

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 6, 2024

Closed for no activity

from rxpermissions.

VitalyKolchenko avatar VitalyKolchenko commented on May 6, 2024

+1 Same error on Samsyng galaxy edge 7 in crashlytics

Fatal Exception: java.lang.RuntimeException: Unable to resume activity {com.bound360.temed.patient/com.tbruyelle.rxpermissions.ShadowActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=42, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} (has extras) }} to activity {com.bound360.temed.patient/com.tbruyelle.rxpermissions.ShadowActivity}: java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request.
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4156)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4250)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3361)
at android.app.ActivityThread.access$1100(ActivityThread.java:222)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=42, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} (has extras) }} to activity {com.bound360.temed.patient/com.tbruyelle.rxpermissions.ShadowActivity}: java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request.
at android.app.ActivityThread.deliverResults(ActivityThread.java:4925)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4142)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4250)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3361)
at android.app.ActivityThread.access$1100(ActivityThread.java:222)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request.
at com.tbruyelle.rxpermissions.RxPermissions.onRequestPermissionsResult(RxPermissions.java:286)
at com.tbruyelle.rxpermissions.ShadowActivity.onRequestPermissionsResult(ShadowActivity.java:32)
at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7263)
at android.app.Activity.dispatchActivityResult(Activity.java:7141)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4921)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4142)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4250)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3361)
at android.app.ActivityThread.access$1100(ActivityThread.java:222)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

from rxpermissions.

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.