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

Platform NullPointerException when calling sendSMS() headless #45

Open
jasonkaruza opened this issue May 18, 2021 · 0 comments
Open

Platform NullPointerException when calling sendSMS() headless #45

jasonkaruza opened this issue May 18, 2021 · 0 comments

Comments

@jasonkaruza
Copy link

Hello,

Flutter Doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.5, on Microsoft Windows [Version 10.0.19041.928], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.56.0)
[√] Connected device (4 available)

Error stack trace:

 *** ERR: (null ctxt) Exception occurred when sending SMS message: PlatformException(error, null, null, kotlin.KotlinNullPointerException
I/flutter (20578):      at com.example.flutter_sms.FlutterSmsPlugin.canSendSMS(FlutterSmsPlugin.kt:58)
I/flutter (20578):      at com.example.flutter_sms.FlutterSmsPlugin.onMethodCall(FlutterSmsPlugin.kt:39)
I/flutter (20578):      at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
I/flutter (20578):      at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
I/flutter (20578):      at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
I/flutter (20578):      at android.os.MessageQueue.nativePollOnce(Native Method)
I/flutter (20578):      at android.os.MessageQueue.next(MessageQueue.java:335)
I/flutter (20578):      at android.os.Looper.loop(Looper.java:206)
I/flutter (20578):      at android.app.ActivityThread.main(ActivityThread.java:8512)
I/flutter (20578):      at java.lang.reflect.Method.invoke(Native Method)
I/flutter (20578):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
I/flutter (20578):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
I/flutter (20578): )
I/flutter (20578): Stack trace

Scenario:
My app runs a headless process that I'd like to send an SMS message from. Any guidance for out to get your plugin (or any plugin to do this in a headless fashion) is greatly appreciated.

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

1 participant