sms_autofill icon indicating copy to clipboard operation
sms_autofill copied to clipboard

After Flutter update, no longer works on IOS

Open Khaled-Eldeeb-BW opened this issue 1 year ago • 15 comments
trafficstars

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-arm64, locale en-EG) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.89.1) [✓] Connected device (4 available) [✓] Network resources

### Error from Terminal `════════ Exception caught by foundation library ════════════════════════════════ The following StateError was thrown while dispatching notifications for FocusNode: Bad state: No element

When the exception was thrown, this was the stack: #0 List.single (dart:core-patch/growable_array.dart:353:22) growable_array.dart:353 #1 TextPainter.getFullHeightForCaret (package:flutter/src/painting/text_painter.dart:1356:122) text_painter.dart:1356 #2 RenderEditable.getLocalRectForCaret (package:flutter/src/rendering/editable.dart:1801:48) editable.dart:1801 #3 EditableTextState._updateComposingRectIfNeeded (package:flutter/src/widgets/editable_text.dart:4491:38) editable_text.dart:4491 #4 EditableTextState._schedulePeriodicPostFrameCallbacks (package:flutter/src/widgets/editable_text.dart:4397:5) editable_text.dart:4397 #5 EditableTextState._openInputConnection (package:flutter/src/widgets/editable_text.dart:3599:7) editable_text.dart:3599 #6 EditableTextState._openOrCloseInputConnectionIfNeeded (package:flutter/src/widgets/editable_text.dart:3633:7) editable_text.dart:3633 #7 EditableTextState._handleFocusChanged (package:flutter/src/widgets/editable_text.dart:4333:5) editable_text.dart:4333 #8 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:433:24) change_notifier.dart:433 #9 FocusNode._notify (package:flutter/src/widgets/focus_manager.dart:1090:5) focus_manager.dart:1090 #10 FocusManager.applyFocusChangesIfNeeded (package:flutter/src/widgets/focus_manager.dart:1850:12) focus_manager.dart:1850 (elided 2 frames from dart:async)

The FocusNode sending notification was: FocusNode#84319([PRIMARY FOCUS]) context: Focus PRIMARY FOCUS`

Khaled-Eldeeb-BW avatar May 26 '24 09:05 Khaled-Eldeeb-BW

does it work if you try the master branch? Also on your stack I don't see any crash from this package so a bit hard to know what's going on.

jaumard avatar Jun 07 '24 09:06 jaumard

PinFieldAutoFill: autofocus and focusNode not working after Flutter update.

Flutter 3.22.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision 5dcb86f68f (5 weeks ago) • 2024-05-09 07:39:20 -0500 Engine • revision f6344b75dc Tools • Dart 3.4.0 • DevTools 2.34.3

sms_autofill: ^2.3.0

FridaySteven avatar Jun 13 '24 03:06 FridaySteven

Also facing the same issue when uopgraded the Flutter version equal to or above 3.22.0.

Working fine on below versions - Flutter 3.19.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision 300451adae (3 months ago) • 2024-03-27 21:54:07 -0500 Engine • revision e76c956498 Tools • Dart 3.3.3 • DevTools 2.31.1

Those who can downgrade the flutter version to solve this problem till @jaumard and team fix this, use command below - flutter downgrade 3.19

Aakash1111 avatar Jun 17 '24 10:06 Aakash1111

@jaumard We are also facing the same issue. it is working fine till flutter version 3.19.5. this is very major issue we are facing. please fix this.

yogeshelevn avatar Jun 19 '24 08:06 yogeshelevn

This packages does nothing on iOS... Maybe something change on flutter side that now needs something to be done. PR are welcome if you want to help.

jaumard avatar Jun 19 '24 08:06 jaumard

@Aakash1111 , the Flutter downgrade command is not working and is giving the following error: "There is no previously recorded version for channel 'master'." is there anything that i can try ??

yogeshelevn avatar Jun 20 '24 08:06 yogeshelevn

same here

gfb-47 avatar Jun 24 '24 17:06 gfb-47

There is no previously recorded version for channel 'master'

https://stackoverflow.com/questions/66545480/flutter-downgrade-error-there-is-no-previously-recorded-version-for-channel - Please try this guide.

Aakash1111 avatar Jun 25 '24 07:06 Aakash1111

I also got the same error on version 3.22.2

tungdevpro avatar Jul 09 '24 01:07 tungdevpro

Did you try with the latest version of sms_autofill 2.4.0? You can see in details how to read OTP from SMS Autofill in Flutter.

Jigneshiosdeveloper avatar Jul 11 '24 04:07 Jigneshiosdeveloper

@Jigneshiosdeveloper We encounter the same issue, and we're on 2.4.0 with Flutter 3.22.2, and we've followed the guide.

The issue only happens when autoFocus: true.

joknjokn avatar Jul 18 '24 11:07 joknjokn

@joknjokn Did you get SMS in your Android phone with appSignature?

<#> You otp code is 121212 appSignature.

Once you get your SMS with this syntax, then only it will work well.

Jigneshiosdeveloper avatar Jul 18 '24 11:07 Jigneshiosdeveloper

@Jigneshiosdeveloper I'm not sure I understand. We only get the "Bad State" error on iOS, and it's not related to the SMS itself in any way - it's autoFocus causing issues.

joknjokn avatar Jul 18 '24 17:07 joknjokn

I have the same issue but not only on IOS side but on Android as well. package version: 2.4.0 Flutter: 3.24.0

Spriggan1992 avatar Aug 15 '24 04:08 Spriggan1992

We are also now getting it on both iOS and Android. It seems like the bug hit Android with Flutter 3.24.0 upgrade.

joknjokn avatar Aug 15 '24 07:08 joknjokn