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

Error while trying to run #3

Closed
akhilgorantala opened this issue May 7, 2022 · 7 comments
Closed

Error while trying to run #3

akhilgorantala opened this issue May 7, 2022 · 7 comments

Comments

@akhilgorantala
Copy link

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.

@X-SLAYER
Copy link
Owner

X-SLAYER commented May 7, 2022

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>

@akhilgorantala
Copy link
Author

yes i added false, but still not able to build.

@X-SLAYER
Copy link
Owner

X-SLAYER commented May 7, 2022

can you share ur AndroidManifest with full error log

@akhilgorantala
Copy link
Author

`

    <service android:label="notifications" android:name="notification.listener.service.NotificationListener" android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
        <intent-filter>
            <action android:name="android.service.notification.NotificationListenerService" />
        </intent-filter>
    </service>

    <activity android:name=".MainActivity" android:exported="false" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
        <!-- Specifies an Android theme to apply to this Activity as soon as
             the Android process has started. This theme is visible to the user
             while the Flutter UI initializes. After that, this theme continues
             to determine the Window background behind the Flutter UI. -->
        <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <!-- Don't delete the meta-data below.
         This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data android:name="flutterEmbedding" android:value="2" />
</application>

`

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.
`

@X-SLAYER
Copy link
Owner

X-SLAYER commented May 8, 2022

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 ?

@X-SLAYER
Copy link
Owner

X-SLAYER commented May 9, 2022

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 X-SLAYER closed this as completed May 9, 2022
@sabeelmuttil
Copy link

@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>
════════════════════════════════════════

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

3 participants