jaumard / sms_autofill

Flutter plugin to provide SMS code autofill support
MIT License
281 stars 173 forks source link

listenForCode() throw platform exception after upgrading flutter 3.7.7 #192

Closed Osama0habib closed 3 weeks ago

Osama0habib commented 1 year ago

listenForCode() throw platform exception after upgrading flutter 3.7.7

this issue happens only on api 33 "i tested it on api 32 and api 29 it works fine without any issues" i edited onrecivefailed method to show the exception

E/flutter ( 8714): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(ERROR_START_SMS_RETRIEVER, Can't start sms retriever, com.google.android.gms.common.api.ApiException: 17: Device doesn't support the messaging feature E/flutter ( 8714): at com.google.android.gms.common.api.internal.TaskUtil.setResultOrApiException(com.google.android.gms:play-services-base@@18.0.1:4) E/flutter ( 8714): at com.google.android.gms.common.api.internal.TaskUtil.setResultOrApiException(com.google.android.gms:play-services-base@@18.0.1:1) E/flutter ( 8714): at com.google.android.gms.internal.auth-api-phone.zzz.zzb(com.google.android.gms:play-services-auth-api-phone@@17.5.1:1) E/flutter ( 8714): at com.google.android.gms.internal.auth-api-phone.zzi.zza(com.google.android.gms:play-services-auth-api-phone@@17.5.1:2) E/flutter ( 8714): at com.google.android.gms.internal.auth-api-phone.zzb.onTransact(com.google.android.gms:play-services-auth-api-phone@@17.5.1:3) E/flutter ( 8714): at android.os.Binder.execTransactInternal(Binder.java:1285) E/flutter ( 8714): at android.os.Binder.execTransact(Binder.java:1244) E/flutter ( 8714): , null) E/flutter ( 8714): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7) E/flutter ( 8714): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:315:18) E/flutter ( 8714): E/flutter ( 8714): #2 SmsAutoFill.listenForCode (package:sms_autofill/sms_autofill.dart:35:5) E/flutter ( 8714):

that was the exception that been logged for me i hope you find a solution to migrate with latest flutter or dart sdk versions

xang555 commented 1 year ago

same issue

AlmogAttal commented 1 year ago

Same issue here

SubrotaDebnath commented 1 year ago

Same Issue Here

himsa commented 1 year ago

any update on this ?

amit-onappr commented 1 year ago

Any update on this?

Osama0habib commented 1 year ago

Acctually i found that this is an google play services error or something .... That issue kept coming for me untill i changed the emulator with the same android api version Its gone then Also i was getting this error on my real device one day and another day its not happening it works perfectly am not sure what is it all about ... But for the quick fix try create another emulator or device

shivam0139 commented 1 year ago

you can use this package : https://pub.dev/packages/otp_pin_field

jaumard commented 3 weeks ago

should be ok on 2.4.0