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

Update LocationUpdatesService.kt #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hamza-Ayed
Copy link

No description provided.

Copy link
Author

@Hamza-Ayed Hamza-Ayed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make for android 14

@MoralCode
Copy link
Collaborator

Thanks for the contribution! Was there a particular error you were getting that led you to believe this was due to android 14 related issues?

@ArbazSparkoSol
Copy link

@MoralCode The app crashes on Android 14 due to new requirements by Android.

@ArbazSparkoSol
Copy link

@Hamza-Ayed Even after applying you fix, the plugin still crashes on Android 14. Did you put any extra permission for it to work?

@fahimalizain
Copy link

I got the following exception on API34:

Java Traceback
E/AndroidRuntime( 4089): java.lang.RuntimeException: Unable to create service com.almoullim.background_location.LocationUpdatesService: java.lang.SecurityException: in.needoo.delivery: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
E/AndroidRuntime( 4089):        at android.app.ActivityThread.handleCreateService(ActivityThread.java:4664)
E/AndroidRuntime( 4089):        at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
E/AndroidRuntime( 4089):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2264)
E/AndroidRuntime( 4089):        at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 4089):        at android.os.Looper.loopOnce(Looper.java:205)
E/AndroidRuntime( 4089):        at android.os.Looper.loop(Looper.java:294)
E/AndroidRuntime( 4089):        at android.app.ActivityThread.main(ActivityThread.java:8177)
E/AndroidRuntime( 4089):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4089):        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/AndroidRuntime( 4089):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
E/AndroidRuntime( 4089): Caused by: java.lang.SecurityException: in.needoo.delivery: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
E/AndroidRuntime( 4089):        at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
E/AndroidRuntime( 4089):        at android.os.Parcel.createException(Parcel.java:3041)
E/AndroidRuntime( 4089):        at android.os.Parcel.readException(Parcel.java:3024)
E/AndroidRuntime( 4089):        at android.os.Parcel.readException(Parcel.java:2966)
E/AndroidRuntime( 4089):        at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5684)
E/AndroidRuntime( 4089):        at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1852)
E/AndroidRuntime( 4089):        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1792)
E/AndroidRuntime( 4089):        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1780)
E/AndroidRuntime( 4089):        at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755)
E/AndroidRuntime( 4089):        at com.almoullim.background_location.LocationUpdatesService.onCreate(LocationUpdatesService.kt:154)
E/AndroidRuntime( 4089):        at android.app.ActivityThread.handleCreateService(ActivityThread.java:4651)
E/AndroidRuntime( 4089):        ... 9 more
E/AndroidRuntime( 4089): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime( 4089):        at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:13927)
E/AndroidRuntime( 4089):        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2570)
E/AndroidRuntime( 4089):        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2720)
E/AndroidRuntime( 4089):        at android.os.Binder.execTransactInternal(Binder.java:1339)
E/AndroidRuntime( 4089):        at android.os.Binder.execTransact(Binder.java:1275)

When testing with the suggested changes in this PR, this error is no more. ✨

@ArbazSparkoSol I didn't have to make any other changes here, just this one line of change.

Copy link

github-actions bot commented Oct 8, 2024

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale label Oct 8, 2024
@MoralCode MoralCode removed the stale label Oct 8, 2024
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

Successfully merging this pull request may close these issues.

4 participants