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

Unable to create NotificationPollService on 1.1-beta18 #77

Closed
AlexBreedveld opened this issue Mar 12, 2024 · 7 comments
Closed

Unable to create NotificationPollService on 1.1-beta18 #77

AlexBreedveld opened this issue Mar 12, 2024 · 7 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AlexBreedveld
Copy link

The latest release has totally broken the app, crashing right on startup.

Logs:

FATAL EXCEPTION: main
Process: com.polar.nextcloudservices, PID: 27893
java.lang.RuntimeException: Unable to create service com.polar.nextcloudservices.Services.NotificationPollService: java.lang.SecurityException: com.polar.nextcloudservices: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4705)
	at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2289)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8248)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
Caused by: java.lang.SecurityException: com.polar.nextcloudservices: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
	at android.os.Parcel.createException(Parcel.java:3041)
	at android.os.Parcel.readException(Parcel.java:3024)
	at android.os.Parcel.readException(Parcel.java:2966)
	at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5713)
	at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1852)
	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1792)
	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1780)
	at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755)
	at com.polar.nextcloudservices.Notification.NotificationController.<init>(NotificationController.java:44)
	at com.polar.nextcloudservices.Services.NotificationPollService.onCreate(NotificationPollService.java:113)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4692)
	... 9 more
Caused by: android.os.RemoteException: Remote stack trace:
	at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:14008)
	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2585)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2763)
	at android.os.Binder.execTransactInternal(Binder.java:1358)
	at android.os.Binder.execTransact(Binder.java:1304)
@0xf104a 0xf104a self-assigned this Mar 12, 2024
@0xf104a 0xf104a added the bug Something isn't working label Mar 12, 2024
@0xf104a 0xf104a added this to the 1.1-beta19 milestone Mar 12, 2024
@0xf104a 0xf104a added the investigate The issue requires investigation and currently can't be labeled as bug or feature request certainly label Mar 12, 2024
@0xf104a
Copy link
Owner

0xf104a commented Mar 12, 2024

Hello. Thankyou for reporting the issue!
Can you please specify Android version you are using app on?

@0xf104a
Copy link
Owner

0xf104a commented Mar 12, 2024

It seems you are using A14 :)
This error introduced since A14(https://stackoverflow.com/questions/77235063/one-of-receiver-exported-or-receiver-not-exported-should-be-specified-when-a-rec)
Unfortunately I do not have A14 device yet, though I would implement fix now

0xf104a added a commit that referenced this issue Mar 12, 2024
@0xf104a
Copy link
Owner

0xf104a commented Mar 12, 2024

@AlexBreedveld can you please test the fix on your device? You can download debug APK here

@AlexBreedveld
Copy link
Author

@AlexBreedveld can you please test the fix on your device? You can download debug APK here

With the compiled APK you've provided it is still crashing. And yes, I am using Android 14. I can try to implement a fix later today, as you've said that you don't have an Android 14 device to test with.

FATAL EXCEPTION: main
Process: com.polar.nextcloudservices, PID: 2485
java.lang.RuntimeException: Unable to create service com.polar.nextcloudservices.Services.NotificationPollService: android.app.MissingForegroundServiceTypeException: Starting FGS without a type  callerApp=ProcessRecord{2c4a494 2485:com.polar.nextcloudservices/u0a500} targetSDK=34
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4705)
	at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2289)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8248)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
Caused by: android.app.MissingForegroundServiceTypeException: Starting FGS without a type  callerApp=ProcessRecord{2c4a494 2485:com.polar.nextcloudservices/u0a500} targetSDK=34
	at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:53)
	at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:49)
	at android.os.Parcel.readParcelableInternal(Parcel.java:4870)
	at android.os.Parcel.readParcelable(Parcel.java:4852)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3052)
	at android.os.Parcel.createException(Parcel.java:3041)
	at android.os.Parcel.readException(Parcel.java:3024)
	at android.os.Parcel.readException(Parcel.java:2966)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6790)
	at android.app.Service.startForeground(Service.java:775)
	at com.polar.nextcloudservices.Services.NotificationPollService.onCreate(NotificationPollService.java:124)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4692)
	... 9 more

@0xf104a
Copy link
Owner

0xf104a commented Mar 12, 2024

@AlexBreedveld can you please test once more? I have fixed the manifest. You can download APK here

@AlexBreedveld
Copy link
Author

12_03-11-11-28_627.log

That worked! I've attached the logs of the app after a fresh install on my device.

@0xf104a
Copy link
Owner

0xf104a commented Mar 12, 2024

Thankyou very much for testing!

@0xf104a 0xf104a closed this as completed Mar 12, 2024
@0xf104a 0xf104a removed the investigate The issue requires investigation and currently can't be labeled as bug or feature request certainly label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants