androidflutterdarttelephony

ERROR:flutter/runtime/dart_vm_initializer.cc(41)Unhandled Exception:PlatformException(failed_to_fetch_sms, Flutter Telephony: Error getting SmsManager


I have never used telephony. I first set up a package and wrote the codes as a pub dev example, but when I send sms after requesting and getting sms permission, it shows this error: [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(failed_to_fetch_sms, Flutter Telephony: Error getting SmsManager, null, null)

My code here:

   await Telephony.instance.sendSms(
                to: controller1.text,
                message: controller2.text
               );

Solution

  • The answer is from https://github.com/shounakmulay/Telephony/issues/149

    You can temporarily use package from my repository by changing telephony package inside pubspec.yaml

    telephony: git: url: https://github.com/suhardik/s_telephony.git ref: develop