Closed akhilgorantala closed 2 years ago
can you try to add this to the intent filter android:exported="false"
Like that
<service android:label="notifications" android:name="notification.listener.service.NotificationListener"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" android:exported="false">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
yes i added false, but still not able to build.
can you share ur AndroidManifest with full error log
`
`
log: `Performing Streamed Install
adb: failed to install C:\Users\AKHIL\StudioProjects\notification_listener_service_1\example\build\app\outputs\flutter-apk\app.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl967353062.tmp/base.apk (at Binary XML file line #22): notification.listener.service.NotificationListener: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present] Error launching application on LE2101. `
can you try to add this to the intent filter
android:exported="false"
Like that<service android:label="notifications" android:name="notification.listener.service.NotificationListener" android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" android:exported="false"> <intent-filter> <action android:name="android.service.notification.NotificationListenerService" /> </intent-filter> </service>
did you change the service with this one ?
can you try to add this to the intent filter
android:exported="false"
Like that<service android:label="notifications" android:name="notification.listener.service.NotificationListener" android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" android:exported="false"> <intent-filter> <action android:name="android.service.notification.NotificationListenerService" /> </intent-filter> </service>
this will solve the problem
@X-SLAYER In my case error showing like this
═╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
The following PlatformException was thrown while activating platform stream on channel
x-slayer/notifications_event:
PlatformException(error, com.payx.app: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be
specified when a receiver isn't being registered exclusively for system broadcasts, null, null)
When the exception was thrown, this was the stack:
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7)
message_codecs.dart:652
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18)
platform_channel.dart:310
<asynchronous suspension>
#2 EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:652:9)
platform_channel.dart:652
<asynchronous suspension>
════════════════════════════════════════
Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present] Error launching application on LE2101.