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

Not working with Android 14 #219

Open
fridayowl opened this issue Apr 9, 2024 · 9 comments
Open

Not working with Android 14 #219

fridayowl opened this issue Apr 9, 2024 · 9 comments

Comments

@fridayowl
Copy link

can't get this package to work on Android 14. It's causing the app to crash

@soyma20
Copy link

soyma20 commented Apr 9, 2024

Same here. I've connected the package as the readme says, but it's crashing the app without an error message

@nikhilmishra83
Copy link

same with android 13.

@fridayowl
Copy link
Author

same with android 13.

It works well with andorid 13 .

@SERCHAT
Copy link

SERCHAT commented Apr 19, 2024

Same with android 14 app crashing after start background service

@marcelxsilva
Copy link

marcelxsilva commented Apr 22, 2024

Maybe it could be this: https://github.com/Rapsssito/react-native-background-actions?tab=readme-ov-file#warning

it worked for me, downgrading the targetSdkVersion version to 33, not good, but I'm looking for another solution.

@rajkumarthirumalai
Copy link

when i try to start the background action,App keep crashing without errors
so i tired adb logcat

and got the below error in it ,May be it might help to resolve

Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.

@faizanbutt
Copy link

@rajkumarthirumalai I updated FLAG_MUTABLE to FLAG_IMMUTABLE but after that I am getting this error:
java.lang.RuntimeException: Unable to start service com.asterinet.react.bgactions.RNBackgroundActionsTask@7a9878a with Intent { cmp=com.myapp/com.asterinet.react.bgactions.RNBackgroundActionsTask (has extras) }: java.lang.SecurityException: Starting FGS with type location callerApp=ProcessRecord{5a92e72 15113:com.myapp/u0a195} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_LOCATION] any of the permissions allOf=false [android.permission.ACCESS_COARSE_LOCATION, android.permission.ACCESS_FINE_LOCATION] and the app must be in the eligible state/exemptions to access the foreground only permission

Did you also faced the same ?
Or how did you solve the previous one ?

@rajkumarthirumalai
Copy link

rajkumarthirumalai commented May 3, 2024

@rajkumarthirumalai I updated FLAG_MUTABLE to FLAG_IMMUTABLE but after that I am getting this error: java.lang.RuntimeException: Unable to start service com.asterinet.react.bgactions.RNBackgroundActionsTask@7a9878a with Intent { cmp=com.myapp/com.asterinet.react.bgactions.RNBackgroundActionsTask (has extras) }: java.lang.SecurityException: Starting FGS with type location callerApp=ProcessRecord{5a92e72 15113:com.myapp/u0a195} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_LOCATION] any of the permissions allOf=false [android.permission.ACCESS_COARSE_LOCATION, android.permission.ACCESS_FINE_LOCATION] and the app must be in the eligible state/exemptions to access the foreground only permission

Did you also faced the same ? Or how did you solve the previous one ?

i made the changes what said here
#200

#200 (comment)

@akinlekan28
Copy link

akinlekan28 commented May 13, 2024

@rajkumarthirumalai I updated FLAG_MUTABLE to FLAG_IMMUTABLE but after that I am getting this error: java.lang.RuntimeException: Unable to start service com.asterinet.react.bgactions.RNBackgroundActionsTask@7a9878a with Intent { cmp=com.myapp/com.asterinet.react.bgactions.RNBackgroundActionsTask (has extras) }: java.lang.SecurityException: Starting FGS with type location callerApp=ProcessRecord{5a92e72 15113:com.myapp/u0a195} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_LOCATION] any of the permissions allOf=false [android.permission.ACCESS_COARSE_LOCATION, android.permission.ACCESS_FINE_LOCATION] and the app must be in the eligible state/exemptions to access the foreground only permission

Did you also faced the same ? Or how did you solve the previous one ?

You're missing <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" /> permission strings. Also make sure your app has the appropriate permissions granted before starting the foreground service.

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

No branches or pull requests

8 participants