Home:ALL Converter>Flutter Build errors xcode ios

Flutter Build errors xcode ios

Ask Time:2022-09-21T22:26:11         Author:blue492

Json Formatter

After upgrading to Xcode 14, I got these errors messages when I try build/run my project on Mac: Android studio -> Build -> Flutter -> Build iOS

shared_preferences: ^2.0.15 Flutter version: 3.3.2

Note that everything were working without any problem before the upgrading, and no problem in Windows.

Automatically signing iOS for device deployment using specified development team in Xcode project: 65456KJ35R
Running Xcode build...                                          
Xcode build done.                                           18.4s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/cc/3b8b8j7s3nd92qwt4_6zgzhh0000gn/T/flutter_tools.DBua0Q/flutter_ios_build_temp_dirdSTTIY/temporary_xcresult_bundle

    /Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:27:41: error: no type or protocol named 'FlutterPluginRegistrar'
    + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
                                            ^
    /Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:29:34: error: property 'messenger' not found on object of type 'NSObject *'
      UserDefaultsApiSetup(registrar.messenger, plugin);
                                     ^
    3 errors generated.
    Command SwiftCompile failed with a nonzero exit code
    note: Building targets in dependency order
    warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')

    Result bundle written to path:
        /var/folders/cc/3b8b8j7s3nd92qwt4_6zgzhh0000gn/T/flutter_tools.DBua0Q/flutter_ios_build_temp_dirdSTTIY/temporary_xcresult_bundle


Generics Issue (Xcode): No type or protocol named 'FlutterPlugin'
/Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.h:5:50

Generics Issue (Xcode): No type or protocol named 'FlutterPluginRegistrar'
/Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:26:40

Semantic Issue (Xcode): Property 'messenger' not found on object of type 'NSObject *'
/Users/test/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:28:33

Uncategorized (Xcode): Command SwiftCompile failed with a nonzero exit code

Encountered error while building for device.
Process finished with exit code 1
flutter run -v

flutter.txt

flutter build ios -v

iosbuild.log

I tested to build the new project with only shared_preferences: ^2.0.15 package and here is the result :

buildlog.log

Following packages have also conflicts while building for iOS in Mac

searchable_dropdown: ^1.1.3
file_picker: ^4.6.1
html_editor_enhanced: ^2.5.0
image_cropper: ^3.0.0

Author:blue492,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73802471/flutter-build-errors-xcode-ios
yy