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

Hi , i just came across flutter_nearby_connections for sharing data between two devices offline,when i tried to use the plugin i got this error #68

Open
Vamshi3130 opened this issue Nov 20, 2024 · 1 comment

Comments

@Vamshi3130
Copy link

I am familiar with flutter code , but dont know much about android files,Im a begginer so sorry in advance not mentioning much on issue, this the error im getting

Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
D/nearby_connections(24406): initNearbyService
E/ServiceBindManager(24406): bindService: coguide.in.offline_online_optim.MainActivity@c5620c0
D/nearby_connections(24406): startBrowsingForPeers
D/AndroidRuntime(24406): Shutting down VM
E/AndroidRuntime(24406): FATAL EXCEPTION: main
E/AndroidRuntime(24406): Process: coguide.in.offline_online_optim, PID: 24406
E/AndroidRuntime(24406): java.lang.RuntimeException: Unable to create service com.nankai.flutter_nearby_connections.NearbyService: java.lang.SecurityException: Starting FGS with type connectedDevice callerApp=ProcessRecord{95239b8 24406:coguide.in.offline_online_optim/u0a525} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE] any of the permissions allOf=false [android.permission.BLUETOOTH_ADVERTISE, android.permission.BLUETOOTH_CONNECT, android.permission.BLUETOOTH_SCAN, android.permission.CHANGE_NETWORK_STATE, android.permission.CHANGE_WIFI_STATE, android.permission.CHANGE_WIFI_MULTICAST_STATE, android.permission.NFC, android.permission.TRANSMIT_IR, android.permission.UWB_RANGING, USB Device, USB Accessory]
E/AndroidRuntime(24406): at android.app.ActivityThread.handleCreateService(ActivityThread.java:5202)
E/AndroidRuntime(24406): at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
E/AndroidRuntime(24406): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2650)
E/AndroidRuntime(24406): at android.os.Handler.dispatchMessage(Handler.java:108)
E/AndroidRuntime(24406): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(24406): at android.os.Looper.loop(Looper.java:328)
E/AndroidRuntime(24406): at android.app.ActivityThread.main(ActivityThread.java:9188)
E/AndroidRuntime(24406): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(24406): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
E/AndroidRuntime(24406): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
E/AndroidRuntime(24406): Caused by: java.lang.SecurityException: Starting FGS with type connectedDevice callerApp=ProcessRecord{95239b8 24406:coguide.in.offline_online_optim/u0a525} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE] any of the permissions allOf=false [android.permission.BLUETOOTH_ADVERTISE, android.permission.BLUETOOTH_CONNECT, android.permission.BLUETOOTH_SCAN, android.permission.CHANGE_NETWORK_STATE, android.permission.CHANGE_WIFI_STATE, android.permission.CHANGE_WIFI_MULTICAST_STATE, android.permission.NFC, android.permission.TRANSMIT_IR, android.permission.UWB_RANGING, USB Device, USB Accessory]
E/AndroidRuntime(24406): at android.os.Parcel.createExceptionOrNull(Parcel.java:3071)
E/AndroidRuntime(24406): at android.os.Parcel.createException(Parcel.java:3055)
E/AndroidRuntime(24406): at android.os.Parcel.readException(Parcel.java:3038)
E/AndroidRuntime(24406): at android.os.Parcel.readException(Parcel.java:2980)
E/AndroidRuntime(24406): at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7433)
E/AndroidRuntime(24406): at android.app.Service.startForeground(Service.java:775)
E/AndroidRuntime(24406): at com.nankai.flutter_nearby_connections.NearbyService.onCreate(NearbyService.kt:32)
E/AndroidRuntime(24406): at android.app.ActivityThread.handleCreateService(ActivityThread.java:5189)
E/AndroidRuntime(24406): ... 9 more
E/AndroidRuntime(24406): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime(24406): at com.android.server.am.ActiveServices.validateForegroundServiceType(ActiveServices.java:2788)
E/AndroidRuntime(24406): at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked(ActiveServices.java:2499)
E/AndroidRuntime(24406): at com.android.server.am.ActiveServices.setServiceForegroundLocked(ActiveServices.java:1836)
E/AndroidRuntime(24406): at com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManagerService.java:15072)
E/AndroidRuntime(24406): at android.app.IActivityManager$Stub.onTransact$setServiceForeground$(IActivityManager.java:12777)
I/Process (24406): Sending signal. PID: 24406 SIG: 9
Lost connection to device.
the Dart compiler exited unexpectedly.

@B-O-B-G-I-T
Copy link

Hello, try this it's an error that seems like this, I tried a fix given in the pull requests
#66 (comment)

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

2 participants