Comments (9)
Hello, thank you for your feedback. I have also found some of some crashes from Google Play console. However, I am unable to reproduce the issue. Can you provide me with a minimal code and/or scenario that leads to the crash?
from android-permissions.
Basically, it goes like this:
- you are doing the permission check in a service (foreground) and it is running with a foreground notification.
- you go to app's permissions in Settings and disable "Location" as in my case
- System will kill the application but I have set Service to be
START_STICKY
inonStartCommand()
so it will recreate it. - I will see the rational dialog saying that this app needs location permission. Usually its quite fast and you see the dialog while you are on the app permission in Settings.
Now at this point, the app itself also appears in background and I think because of PermissionActivity
. Problem occurs when you try to bring the app to foreground because it will crash and you will see the error in the logs which I mentioned in my first comment.
I know it's quite an edge case but still a relevant one in my case where user can revoke the permission and I would like to show a dialog to make him aware of the consequences.
from android-permissions.
I might have tried to fix it myself but lack extra time to invest so maybe there is something you can do about it otherwise I will find a workaround.
from android-permissions.
Hello, I have made an attempt to fix the issue. Can you please checkout the branch "temp" and verify if it has been solved?
To test:
- Checkout branch 'temp'.
- Run the task 'assembleRelease' of module 'permissions' in Gradle.
- Locate the AAR file in the build/outputs/aar
- Use the AAR file as dependency in your project instead of gradle dependency.
from android-permissions.
THanks @nabinbhandari for the effort. I will try it out and will share my feedback.
from android-permissions.
No man, unfortunately it is still getting the same error. I definitely used the permissions-release.aar
file and used the module instead of the global dependency.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.blah.blah.debug/com.nabinbhandari.android.permissions.PermissionsActivity}: java.lang.IllegalArgumentException: permission cannot be null or empty
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.IllegalArgumentException: permission cannot be null or empty
at android.content.pm.PackageManager.buildRequestPermissionsIntent(PackageManager.java:4054)
at android.app.Activity.requestPermissions(Activity.java:4294)
at com.nabinbhandari.android.permissions.PermissionsActivity.onCreate(PermissionsActivity.java:72)
at android.app.Activity.performCreate(Activity.java:6942)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Probably, I will let the service not start again once permissions are revoked but show a notification as a fallback plan.
from android-permissions.
at android.app.Activity.requestPermissions(Activity.java:4294)
at com.nabinbhandari.android.permissions.PermissionsActivity.onCreate(PermissionsActivity.java:72)
I am sure you are still using the old code because the source code has changed and line of crash is still the same.
Perhaps you checked out the master branch instead of temp.
from android-permissions.
Ahan, maybe I made a mistake. Let me try again.
from android-permissions.
The crash has been fixed. Thank you.
from android-permissions.
Related Issues (20)
- Multiple permissions not working HOT 3
- Where are the new versions published? HOT 1
- I never see the permission request. HOT 1
- Unable to see the custom rationale dialog on app start or at least it's random HOT 2
- min SDK 16 problem HOT 1
- Crash on Android 9.0 when using this library outside of an Activity HOT 5
- App Crashes on Android 6.0 Only (android.util.AndroidRuntimeException:) HOT 2
- Any way to center the text of the dialog? HOT 1
- Is it possible to call and get permission callbacks in Fragment? HOT 1
- Runtime Exception HOT 2
- PermissionHandler callbacks are never called for separate process
- Crash on Android Q HOT 1
- One time i check "Set Not to ask again", it always show setting dialog HOT 1
- Change color HOT 1
- Options when checking for single permission HOT 1
- Not showing rational message HOT 1
- targetSdkVersion HOT 1
- Migrate from JCenter HOT 18
- Not working for android 13 HOT 1
- issue with android 13 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-permissions.