Telephony
Telephony copied to clipboard
Error Sending message on Real Device
While sending an sms from a real device having android 11 with having permission: SEND_SMS,
call to function
await telephony.sendSms(
to: mobileNum,
message: message,
statusListener: onSendStatus,
);
throwing an exception
E/flutter (22839): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(failed_to_fetch_sms, Flutter Telephony: Error getting SmsManager, null, null)
E/flutter (22839): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (22839): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:18)
E/flutter (22839): <asynchronous suspension>
E/flutter (22839): #2 Telephony.sendSms (package:telephony/telephony.dart:321:5)
E/flutter (22839): <asynchronous suspension>
Also having this issue
also Having this issue, any news about it?
me too... i cant send sms... Unhandled Exception: PlatformException(failed_to_fetch_sms, Flutter Telephony: Error getting SmsManager, null, null)
did you find any solution ?
me too... i cant send sms... Unhandled Exception: PlatformException(failed_to_fetch_sms, Flutter Telephony: Error getting SmsManager, null, null)
did you find any solution ?
https://github.com/shounakmulay/Telephony/pull/153
The fix in this PR solved it for me
Facing this issue too. Can anyone have the solution for this?
facing same issue, i'm wondered this issue is open for 1 year
Facing this issue too...
#153
hope this help
for everyone who facing this issue and still have no idea how to fix this... 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
e: /Users/shanta/FlutterSetUp/flutter/.pub-cache/git/s_telephony-78a83137120ce23b252454825272624ff37a8e1b/android/src/main/kotlin/com/shounakmulay/telephony/sms/SmsController.kt: (27, 7): Redeclaration: SmsController e: /Users/shanta/FlutterSetUp/flutter/.pub-cache/hosted/pub.dartlang.org/telephony-0.2.0/android/src/main/kotlin/com/shounakmulay/telephony/sms/SmsController.kt: (27, 7): Redeclaration: SmsController
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':telephony:compileDebugKotlin'.
Compilation error. See log for more details
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
- Get more help at https://help.gradle.org
BUILD FAILED in 14s Exception: Gradle task assembleDebug failed with exit code 1
e: /Users/shanta/FlutterSetUp/flutter/.pub-cache/git/s_telephony-78a83137120ce23b252454825272624ff37a8e1b/android/src/main/kotlin/com/shounakmulay/telephony/sms/SmsController.kt: (27, 7): Redeclaration: SmsController e: /Users/shanta/FlutterSetUp/flutter/.pub-cache/hosted/pub.dartlang.org/telephony-0.2.0/android/src/main/kotlin/com/shounakmulay/telephony/sms/SmsController.kt: (27, 7): Redeclaration: SmsController
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':telephony:compileDebugKotlin'.
Compilation error. See log for more details
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
- Get more help at https://help.gradle.org
BUILD FAILED in 14s Exception: Gradle task assembleDebug failed with exit code 1
i think its different problem. you can try to run "flutter pub clean" and then run "flutter pub get", and finally, run "flutter run"
i have changed pubspec.yaml as you said. but yet i am facing the same issue. i have ran flutter clean, flutter pub get but yet the problem has not been resolved
also problem myself, it doesn't work on old devices
also problem myself, it doesn't work on old devices
yes i guess. minSdkVersion of this library is 23. so it means that this library only works on device with OS Android 6.0 and later
also problem myself, it doesn't work on old devices
yes i guess. minSdkVersion of this library is 23. so it means that this library only works on device with OS Android 6.0 and later
My sdk is 26 :(
Hello! Is there someone who solved this problem?Thanks
I changed plugin, I'm using this: https://pub.dev/packages/background_sms
This problem still persist!
almost 1 year but still not getting merged. for anyone who still get this error, you can try this solution: https://github.com/shounakmulay/Telephony/issues/149#issuecomment-1212695720
hope this help :)
almost 1 year but still not getting merged. for anyone who still get this error, you can try this solution: #149 (comment)
hope this help :)
This help boss, thank you