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

[Bug] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil' #605

Open
AdamTechAcc opened this issue Sep 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@AdamTechAcc
Copy link

AdamTechAcc commented Sep 29, 2024

Steps to reproduce

I have an app with registration screens. When for example 3rd screen has TypeAheadField and we go through to the end of registration process and back to starting screen:

Navigator.of(context).pushNamedAndRemoveUntil(StartScreen.routeName, (Route<dynamic> route) => false);

Then when we reload app by clicking 'Play' button in Android Studio and trying to go to the screen with TypeAheadField problem occurs. App freezed between screens route animation. When I do not reload app everything works fine. Also when I don't use TypeAheadField everything works.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x18ca0908c ...)
libc++abi: terminating due to uncaught exception of type NSException  
 

Problem is even for just that TypeAheadField configuration:

      TypeAheadField<String>(
            builder: (context, controller, focusNode) => Text('aaaaaa'),
            itemBuilder: (context, String suggestion) => Text('item'),
            suggestionsCallback: (pattern) => ['aaaaaaaa'],
            onSelected: (x) {},
          ),
❯ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0 24A335 darwin-arm64, locale pl-PL)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.92.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

Expected results

No internal error

Actual results

App crashes with Terminating app due to uncaught exception 'NSInvalidArgumentException'

Package Version

5.2.0

Platform

iOS

Code sample

Code sample
[Paste your code here]

Logs

Logs
[Paste your logs here]

Screenshots or Video

Screenshots / Video demonstration [Upload media here]
@AdamTechAcc AdamTechAcc added the bug Something isn't working label Sep 29, 2024
@venbrinoDev
Copy link

Just encounter this bug

any fix ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants