-
Notifications
You must be signed in to change notification settings - Fork 40
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
Application crashes on Android 11 - java.lang.SecurityException #19
Comments
We are facing the same crashes on Android 10 as well. Also see #20, are you experiencing that as well? |
I think they are different errors, mine is about permissions and how the android 11 handle this. Your error is a null pointer exception, this is proprably something about the java code, try to use the latest version. |
@caiorsantanna we are using 1.1.3. We know it is a different issue, we were asking whether your app is experiencing that error as well. |
|
@caiorsantanna we are currently testing this fork, you could give it a try https://bitbucket.org/epicollect/cordova-foreground-plugin/src/master/ |
Same for me, mostly on Redmi devices with Android 11: java.lang.RuntimeException: |
Thank you for your message. However, the current repository is not fully open source. To access it, one must be a sponsor, as detailed at Capawesome Insiders. Our policy is to distribute our code as open source, and using a "sponsorship" based plugin would require any forks to also become sponsors. This would not align with our open-source distribution model. |
NOTE: Please make sure you read the readme and fully understand the use of this plugin and its requirements before opening an issue.
Describe the bug
Hi, I've been working on the main app where I work. One of its main features is the ability to take pictures.
As you will see in the environment below, I use ionic with angular, and what happens to me is the following:
On some devices, the ionic camera plugin has been resetting its state, due to the memory wipe that android does with apps in the background, since the ionic camera plugin opens the camera's native app, and only after back to your app.
After some research I fixed this using the foreground plugin for ionic (this plugin), opening it before the camera starts, and then closing it, to prevent android from understanding that my app is in the background and resetting it.
This fixed the problem for most devices, except for some devices that use android 11, strangely not all.
After taking a look at the google play crash logs, I noticed that most of them gave the error below, coming from this plugin.
To Reproduce
Well, it's not very clear how to reproduce this problem. What I do know is that it happens on android 11 due to security issues implemented in this version, as you can see here: https://developer.android.com/guide/components/foreground-services
See some implementation of mine:
Expected behavior
Should open the foreground service without crashing the app
Smartphone (please complete the following information):
About affected devices:
About the version of things:
Additional context
Well, i think the solution to this have some to do with this permissions:
So i tried:
But when i tried to do it i am getting this error:
And i am in a dead end :( What i doing wrong?
The text was updated successfully, but these errors were encountered: