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

Sms is being sent but exception is thrown #8

Open
pryshrm opened this issue Dec 18, 2021 · 2 comments
Open

Sms is being sent but exception is thrown #8

pryshrm opened this issue Dec 18, 2021 · 2 comments

Comments

@pryshrm
Copy link

pryshrm commented Dec 18, 2021

Here is my code:

SmsSender sender = SmsSender();
SmsMessage message = new SmsMessage(address, 'Hello flutter world222!');
message.onStateChanged.listen((state) {
  if (state == SmsMessageState.Sent) {
    print("SMS is sent!");
  } else if (state == SmsMessageState.Delivered) {
    print("SMS is delivered!");
  }
});
sender.sendSms(message).then((value) => print('after sendsms $value'));

Here is the exception:

Syncing files to device ASUS X00TD...
E/EventChannel#plugins.elyudde.com/statusSMS(12264): Failed to open event stream
E/EventChannel#plugins.elyudde.com/statusSMS(12264): java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter o
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at com.elyudde.sms_advanced.status.SmsStateHandler.onListen(Unknown Source:2)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:188)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:167)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at android.os.MessageQueue.nativePollOnce(Native Method)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at android.os.MessageQueue.next(MessageQueue.java:326)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at android.os.Looper.loop(Looper.java:160)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at android.app.ActivityThread.main(ActivityThread.java:6692)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at java.lang.reflect.Method.invoke(Native Method)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/EventChannel#plugins.elyudde.com/statusSMS(12264): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/flutter (12264): after sendsms Instance of 'SmsMessage'

======== Exception caught by services library ======================================================
The following PlatformException was thrown while activating platform stream on channel plugins.elyudde.com/statusSMS:
PlatformException(error, Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter o, null, null)

When the exception was thrown, this was the stack:
#0 JSONMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:155:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)

#2 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:486:9)

Any idea why?

@isaacdarcilla
Copy link

same

@JLFFFF
Copy link

JLFFFF commented Aug 15, 2022

Try to grant the permission in Settings app.
and check 3341c41

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