简体   繁体   中英

Flutter app crash on startup (only IOS, both simulator and real device)

Android app works normal.

flutter version: stable 1.17.5

flutter doctor - everything ok

flutter pubs:

cupertino_icons: ^0.1.3
device_preview: ^0.4.4
http: ^0.12.0+4
crypto: ^2.1.4
provider: ^4.0.5
get_it: ^4.0.1
flutter_secure_storage: ^3.3.3
shared_preferences: ^0.5.7
pin_code_fields: ^2.5.1
gradient_app_bar: ^0.1.3
flutter_slidable: ^0.5.4
image_picker: ^0.6.6+1
datetime_picker_formfield: ^1.0.0
intl: ^0.16.1
dio: ^3.0.9
mime: ^0.9.6+3
image_cropper: ^1.2.2
grouped_list: ^3.0.1
path_provider: ^1.6.9
open_file: ^3.0.1
url_launcher: ^5.4.10
table_calendar: ^2.2.3
smooth_star_rating: ^1.1.1
file_picker: ^1.12.0
month_picker_dialog: ^0.3.2

Can't find error, only print log is this:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean length]:
unrecognized selector sent to instance

I was looking for answer for 5 hours, did everything from flutter clean, deleted pods, Podfile.lock, updated Podfile, deleted and reinstalled all plugins, used all of flutter commands (flutter pub cache repair, flutter pub upgrade, pod repo update) nothing worked.

I found an error. In info.plist I removed by accident

<key>UIMainStoryboardFile</key>
<string>Main</string>

and replaced it with

<key>UIMainStoryboardFile</key>
<true/>

I pushed this change on Github and for a month I only tested app on Android, so nothing was showing that here was an error but finally I found it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM