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

Fatal Exception: java.lang.RuntimeException Unable to start receiver com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver: java.lang.RuntimeException: Missing type parameter. #1490

Closed
dikshantrawal opened this issue Feb 16, 2022 · 4 comments

Comments

@dikshantrawal
Copy link

When I have updated the flutter version and this library version from 8.1.1 to 9.3.2. And the application is crashing only in release mode in debug mode app is not crashing.

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver: java.lang.RuntimeException: Missing type parameter.
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3858)
at android.app.ActivityThread.access$1500(ActivityThread.java:227)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1901)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7592)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

@MaikuB
Copy link
Owner

MaikuB commented Feb 16, 2022

As mentioned here, make sure you've done the release build configuration. If you have done so and still have an issue, please provide a link to a repository with a minimal app that can reproduce the issue

@MaikuB
Copy link
Owner

MaikuB commented Mar 12, 2022

Closing due to lack of further response. If you have done all the release build configuration and still have an issue, please use the bug report template and include a link to a repository that has an minimal app that can reproduce the issue

@MaikuB MaikuB closed this as completed Mar 12, 2022
@SrivastavaShubham99
Copy link

SrivastavaShubham99 commented Jul 8, 2022

I also getting this error .

================. MANIFST FILE =========================


























<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <activity
        android:name=".MainActivity"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:requestLegacyExternalStorage="true"
        android:allowBackup="false"
        android:fullBackupContent="false"
        android:usesCleartextTraffic="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"
          />
        <!-- Displays an Android View that continues showing the launch screen
             Drawable until Flutter paints its first frame, then this splash
             screen fades out. A splash screen is useful to avoid any visual
             gap between the end of Android's launch screen and the painting of
             Flutter's first frame. -->
        <meta-data
          android:name="io.flutter.embedding.android.SplashScreenDrawable"
          android:resource="@drawable/launch_background"
          />
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>

   <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
   <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
       <intent-filter>
           <action android:name="android.intent.action.BOOT_COMPLETED"></action>
       </intent-filter>
   </receiver>
    <!-- <queries>
      <intent>
        <action android:name="android.intent.action.INSERT" />
        <data android:mimeType="vnd.android.cursor.item/event" />
      </intent>
    </queries> -->
    <!-- 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>

==============NOTIFICATION SERVICE=====================

import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:timezone/data/latest.dart' as tz;
import 'package:timezone/timezone.dart' as tz;

class LocalNotificationService {
//Singleton pattern
static final LocalNotificationService _notificationService =
LocalNotificationService._internal();
factory LocalNotificationService() {
return _notificationService;
}
LocalNotificationService._internal();

//instance of FlutterLocalNotificationsPlugin
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();

Future init() async {

//Initialization Settings for Android
const AndroidInitializationSettings initializationSettingsAndroid =
AndroidInitializationSettings('@mipmap/ic_launcher');

//Initialization Settings for iOS
const IOSInitializationSettings initializationSettingsIOS =
IOSInitializationSettings(
  requestSoundPermission: false,
  requestBadgePermission: false,
  requestAlertPermission: false,
);

//InitializationSettings for initializing settings for both platforms (Android & iOS)
const InitializationSettings initializationSettings =
InitializationSettings(
    android: initializationSettingsAndroid,
    iOS: initializationSettingsIOS);

tz.initializeTimeZones();

await flutterLocalNotificationsPlugin.initialize(
  initializationSettings,
);

}

final AndroidNotificationDetails _androidNotificationDetails =
const AndroidNotificationDetails(
'channel ID',
'channel name',
icon: '@mipmap/ic_launcher',
playSound: true,
priority: Priority.high,
importance: Importance.high,
);

Future scheduleNotifications() async {
await flutterLocalNotificationsPlugin.zonedSchedule(
0,
"Notification Title",
"This is the Notification Body!",
tz.TZDateTime.now(tz.local).add(const Duration(seconds: 5)),
NotificationDetails(android: _androidNotificationDetails),
androidAllowWhileIdle: true,
uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime);
}
}

@ubitechparth
Copy link

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(error, Missing type parameter., null, java.lang.RuntimeException: Mis
sing type parameter.
E/flutter ( 1704): at d.e.c.T.a.(:3)
E/flutter ( 1704): at com.dexterous.flutterlocalnotifications.c.(Unknown Source:0)
E/flutter ( 1704): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.loadScheduledNotifications(Unknown Source:25)
E/flutter ( 1704): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.saveScheduledNotification(Unknown Source:0)
E/flutter ( 1704): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.zonedScheduleNotification(Unknown Source:80)
E/flutter ( 1704): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.zonedSchedule(:2)
E/flutter ( 1704): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.onMethodCall(Unknown Source:361)
E/flutter ( 1704): at h.a.e.a.z.a(Unknown Source:17)
E/flutter ( 1704): at io.flutter.embedding.engine.n.q.j(Unknown Source:11)
E/flutter ( 1704): at io.flutter.embedding.engine.n.q.k(:1)
E/flutter ( 1704): at io.flutter.embedding.engine.n.c.run(Unknown Source:12)
E/flutter ( 1704): at android.os.Handler.handleCallback(Handler.java:938)
E/flutter ( 1704): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter ( 1704): at android.os.Looper.loop(Looper.java:246)
E/flutter ( 1704): at android.app.ActivityThread.main(ActivityThread.java:8633)
E/flutter ( 1704): at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 1704): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
E/flutter ( 1704): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
E/flutter ( 1704): )
E/flutter ( 1704): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607)
E/flutter ( 1704): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167)
E/flutter ( 1704):
E/flutter ( 1704): #2 AndroidFlutterLocalNotificationsPlugin.zonedSchedule (package:flutter_local_notifications/src/platform_flutter_local_notifications.dart:214)
E/flutter ( 1704):

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

4 participants