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

await SmsAutoFill().hint not working #233

Open
Shub0327 opened this issue Jun 11, 2024 · 3 comments
Open

await SmsAutoFill().hint not working #233

Shub0327 opened this issue Jun 11, 2024 · 3 comments

Comments

@Shub0327
Copy link

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.credentials.HintRequest$Builder" on path: DexPathList
@OverRide
void initState() {
super.initState();

Timer(Duration(milliseconds: 1000), () {
  initMobileNumberState();
});

}

Future initMobileNumberState() async {
try {
String? hint = await SmsAutoFill().hint;
String? number = _formatPhoneNumber(hint ?? "");
_signInController.phoneNumberController.text = number;
// _signInController.phoneNumber.value = number;
} on PlatformException catch (e) {
debugPrint("Failed to get mobile number because of '${e.message}'");
}
}

@sahilmehra98
Copy link
Contributor

Which version of the plugin are you using?

@kamrujjamanjoy
Copy link

i am using your example code and its says phone number not found

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(ERROR, 16: [28438] No phone number is found on this device., com.google.android.gms.common.api.ApiException: 16: [28438] No phone number is found on this device.
E/flutter (31315): at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base@@18.3.0:3)
E/flutter (31315): at com.google.android.gms.common.api.internal.TaskUtil.setResultOrApiException(com.google.android.gms:play-services-base@@18.3.0:4)
E/flutter (31315): at com.google.android.gms.internal.auth-api.zbao.zbb(com.google.android.gms:play-services-auth@@21.2.0:1)
E/flutter (31315): at com.google.android.gms.internal.auth-api.zbn.zba(com.google.android.gms:play-services-auth@@21.2.0:4)
E/flutter (31315): at com.google.android.gms.internal.auth-api.zbb.onTransact(com.google.android.gms:play-services-auth@@21.2.0:3)
E/flutter (31315): at android.os.Binder.execTransactInternal(Binder.java:1363)
E/flutter (31315): at android.os.Binder.execTransact(Binder.java:1304)
E/flutter (31315): , null)
E/flutter (31315): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:646:7)
E/flutter (31315): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
E/flutter (31315):
E/flutter (31315): #2 SmsAutoFill.hint (package:sms_autofill/sms_autofill.dart:33:28)
E/flutter (31315):
E/flutter (31315): #3 _PhoneFieldHintState._askPhoneHint (package:sms_autofill/sms_autofill.dart:393:20)
E/flutter (31315):
E/flutter (31315): #4 _PhoneFieldHintState.build. (package:sms_autofill/sms_autofill.dart:335:21)
E/flutter (31315):

@amit-iconflux
Copy link

amit-iconflux commented Feb 6, 2025

I'm encountering this issue on a Samsung device with Android 14, although it works fine on other devices, including those with Android 14. This problem appears to be limited to Samsung's Android 14.

Tested device:

✅ POCO X4 (Android 13): Working
✅ Google Pixel 8 (Android 14): Working
✅ Samsung M30 (Android 11): Working
✅ Samsung M31 (Android 12): Working
✅ OnePlus 12R (Android 15): Working
✅ OnePlus Nord CE2 Lite (Android 14): Working
❌ Samsung S24 Ultra (Android 14): Not working
❌ Samsung A34 (Android 14): Not working

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

4 participants