Firebase – Flutter Firebase Project won’t compile after ‘pod update’

cocoapodsfirebaseflutter

after I run pod update in my flutter project, my project won't compile for iOs. Thats what I already tried.

  • Deleting the Pod Folder.
  • Deleting the Podfile
  • Running Pod init to create a new Podfile
  • Paste the Code to the new Podfile and run Pod istall again.

    $ flutter doctor -v

    [✓] Flutter (Channel dev, v1.2.1, on Mac OS X 10.14.3 18D109, locale de-DE)
    • Flutter version 1.2.1 at /Users/mainuser/Development/flutter
    • Framework revision 8661d8aecd (3 days ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

    [✓] Android toolchain – develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/alexanderwilke/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

    [✓] iOS toolchain – develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.6.0

    [✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 32.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

    [✓] VS Code (version 1.31.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.23.0

    [!] Connected device
    ! No devices available


Error Output:

Running pod install...                                              4,7s

> Xcode build done.                                            3,6s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


> Xcode's output:
↳
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:29:50: warning: 'window' is only available on iOS 5.0 or newer
    [-Wunguarded-availability]
          [UIApplication sharedApplication].delegate.window.rootViewController;
                                                     ^~~~~~
    In module 'UIKit' imported from /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:398:51: note: 'window' has been explicitly
    marked partial here
    @property (nullable, nonatomic, strong) UIWindow *window NS_AVAILABLE_IOS(5_0);
                                                      ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:29:50: note: enclose 'window' in an @available check to silence this warning
          [UIApplication sharedApplication].delegate.window.rootViewController;
                                                     ^~~~~~
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:79:45: warning: 'kUTTypeAVIMovie' is only available on iOS 8.0 or newer
    [-Wunguarded-availability]
          (NSString *)kUTTypeMovie, (NSString *)kUTTypeAVIMovie, (NSString *)kUTTypeVideo,
                                                ^~~~~~~~~~~~~~~
    In module 'MobileCoreServices' imported from /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:7:
    In module 'CoreServices' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/MobileCoreServices.framework/Headers/MobileCoreServices.h:9:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h:892:26: note: 'kUTTypeAVIMovie' has been
    explicitly marked partial here
    extern const CFStringRef kUTTypeAVIMovie                             __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0);
                             ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:79:45: note: enclose 'kUTTypeAVIMovie' in an @available check to silence this
    warning
          (NSString *)kUTTypeMovie, (NSString *)kUTTypeAVIMovie, (NSString *)kUTTypeVideo,
                                                ^~~~~~~~~~~~~~~
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:111:22: warning: 'presentViewController:animated:completion:' is only available on
    iOS 5.0 or newer [-Wunguarded-availability]
        [_viewController presentViewController:_imagePickerController animated:YES completion:nil];
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'UIKit' imported from /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:227:1: note:
    'presentViewController:animated:completion:' has been explicitly marked partial here
    - (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^ __nullable)(void))completion NS_AVAILABLE_IOS(5_0);
    ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:111:22: note: enclose 'presentViewController:animated:completion:' in an @available
    check to silence this warning
        [_viewController presentViewController:_imagePickerController animated:YES completion:nil];
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:124:20: warning: 'presentViewController:animated:completion:' is only available on
    iOS 5.0 or newer [-Wunguarded-availability]
      [_viewController presentViewController:_imagePickerController animated:YES completion:nil];
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'UIKit' imported from /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:227:1: note:
    'presentViewController:animated:completion:' has been explicitly marked partial here
    - (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^ __nullable)(void))completion NS_AVAILABLE_IOS(5_0);
    ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:124:20: note: enclose 'presentViewController:animated:completion:' in an @available
    check to silence this warning
      [_viewController presentViewController:_imagePickerController animated:YES completion:nil];
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:131:27: warning: 'dismissViewControllerAnimated:completion:' is only available on
    iOS 5.0 or newer [-Wunguarded-availability]
      [_imagePickerController dismissViewControllerAnimated:YES completion:nil];
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'UIKit' imported from /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:229:1: note:
    'dismissViewControllerAnimated:completion:' has been explicitly marked partial here
    - (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion NS_AVAILABLE_IOS(5_0);
    ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:131:27: note: enclose 'dismissViewControllerAnimated:completion:' in an @available
    check to silence this warning
      [_imagePickerController dismissViewControllerAnimated:YES completion:nil];
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:185:27: warning: 'dismissViewControllerAnimated:completion:' is only available on
    iOS 5.0 or newer [-Wunguarded-availability]
      [_imagePickerController dismissViewControllerAnimated:YES completion:nil];
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'UIKit' imported from /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:229:1: note:
    'dismissViewControllerAnimated:completion:' has been explicitly marked partial here
    - (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion NS_AVAILABLE_IOS(5_0);
    ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.4.12+1/ios/Classes/ImagePickerPlugin.m:185:27: note: enclose 'dismissViewControllerAnimated:completion:' in an @available
    check to silence this warning
      [_imagePickerController dismissViewControllerAnimated:YES completion:nil];
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 warnings generated.
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:4:8: error: unknown type name 'FIRVisionLabelDetector'; did you mean
    'FIRVisionFaceDetector'?
    static FIRVisionLabelDetector *detector;
           ^~~~~~~~~~~~~~~~~~~~~~
           FIRVisionFaceDetector
    In module 'FirebaseMLVision' imported from /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/Headers/Private/Firebase/Firebase.h:70:
    /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/FirebaseMLVision/Frameworks/FirebaseMLVision.framework/Headers/FIRVisionFaceDetector.h:22:12: note: 'FIRVisionFaceDetector' declared here
    @interface FIRVisionFaceDetector : NSObject
               ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:35:4: error: expected a type
    + (FIRVisionLabelDetectorOptions *)parseOptions:(NSDictionary *)optionsData {
       ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:10:22: error: no visible @interface for 'FIRVision' declares the selector
    'labelDetectorWithOptions:'
      detector = [vision labelDetectorWithOptions:[LabelDetector parseOptions:options]];
                  ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:13:37: error: unknown type name 'FIRVisionLabel'; did you mean 'FIRVisionFace'?
                   completion:^(NSArray<FIRVisionLabel *> *_Nullable labels, NSError *_Nullable error) {
                                        ^~~~~~~~~~~~~~
                                        FIRVisionFace
    In module 'FirebaseMLVision' imported from /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/Headers/Private/Firebase/Firebase.h:70:
    /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/FirebaseMLVision/Frameworks/FirebaseMLVision.framework/Headers/FIRVisionFaceDetector.h:3:8: note: 'FIRVisionFace' declared here
    @class FIRVisionFace;
           ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:22:23: error: use of undeclared identifier 'FIRVisionLabel'
                     for (FIRVisionLabel *label in labels) {
                          ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:22:39: error: use of undeclared identifier 'label'; did you mean 'labels'?
                     for (FIRVisionLabel *label in labels) {
                                          ^~~~~
                                          labels
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:13:66: note: 'labels' declared here
                   completion:^(NSArray<FIRVisionLabel *> *_Nullable labels, NSError *_Nullable error) {
                                                                     ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:24:40: error: use of undeclared identifier 'label'
                         @"confidence" : @(label.confidence),
                                           ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:25:36: error: use of undeclared identifier 'label'
                         @"entityID" : label.entityID,
                                       ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:26:33: error: use of undeclared identifier 'label'
                         @"label" : label.label
                                    ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:12:13: error: no visible @interface for 'FIRVisionFaceDetector' declares the
    selector 'detectInImage:completion:'
      [detector detectInImage:image
       ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:37:12: error: unknown receiver 'FIRVisionLabelDetectorOptions'; did you mean
    'FIRVisionFaceDetectorOptions'?
      return [[FIRVisionLabelDetectorOptions alloc] initWithConfidenceThreshold:[conf floatValue]];
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               FIRVisionFaceDetectorOptions
    In module 'FirebaseMLVision' imported from /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/Headers/Private/Firebase/Firebase.h:70:
    /Users/mainuser/Documents/flutter_projects/firebaseProject/ios/Pods/FirebaseMLVision/Frameworks/FirebaseMLVision.framework/Headers/FIRVisionFaceDetectorOptions.h:72:12: note: 'FIRVisionFaceDetectorOptions'
    declared here
    @interface FIRVisionFaceDetectorOptions : NSObject
               ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_ml_vision-0.2.1/ios/Classes/LabelDetector.m:37:49: error: no visible @interface for 'FIRVisionFaceDetectorOptions' declares the
    selector 'initWithConfidenceThreshold:'
      return [[FIRVisionLabelDetectorOptions alloc] initWithConfidenceThreshold:[conf floatValue]];
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    12 errors generated.
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5+1/ios/Classes/FirebaseCorePlugin.m:13:17: warning: property 'dictionary' requires method 'dictionary' to be defined -
    use @dynamic or provide a method implementation in this category [-Wobjc-property-implementation]
    @implementation FIROptions (FLTFirebaseCorePlugin)
                    ^
    /Users/mainuser/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5+1/ios/Classes/FirebaseCorePlugin.m:10:46: note: property declared here
    @property(readonly, nonatomic) NSDictionary *dictionary;
                                                 ^
    1 warning generated.

Best Answer

I fixed it by myself!

Here is what I did:

1. Make a new Flutter Project.

2. Copy all your files from /lib to the new project.

3. Delete the flutter/.pub-cache/hosted in your flutter Dir

4. Copy the `pubspec.yaml` file into new project.

5. Run flutter packages get

6. Delete the Pod folder in your PROJECT_DIR/ios folder, the Podfile.lock and the .workscape file (or just run 'pod clean' if you have the right cocoa pods version) 

7. Go into the PROJECT_DIR/ios folder and run pod install

Thats it, your Flutter App should work again :)

Related Topic