Firebase Auth for iOS issue

604 views
Skip to first unread message

Marc Andrew

unread,
Mar 9, 2019, 4:28:02 AM3/9/19
to Flutter Dev
Hi all,

I'm getting an errors from Xcode when I'm trying to run my app.
I create a new project in Firebase with my bundle ID, downloaded the GoogleService-Info.plist and added the file in my Runner folder in Xcode.
After that I added the latest firebase_auth: ^0.8.1+4 dependency in my pubspec.yaml file.

When I start to run my app from Android Studio it fails.

Failed to build iOS app
Error output from Xcode build:

   
** BUILD FAILED **




Xcode's output:

    === BUILD TARGET firebase_auth OF PROJECT Pods WITH CONFIGURATION Debug ===
    /Users/marcandrew/Development/apps/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/ios/Classes/FirebaseAuthPlugin.m:74:41: error: incompatible block pointer types sending '
void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')
            signInAnonymouslyWithCompletion:^(FIRAuthDataResult *authResult, NSError *error) {
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /Users/marcandrew/Development/apps/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/ios/Classes/FirebaseAuthPlugin.m:7:
    In file included from /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Private/Firebase/Firebase.h:13:
    In file included from /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Public/FirebaseAuth/FirebaseAuth/FirebaseAuth.h:4:
    /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Public/FirebaseAuth/FirebaseAuth/FIRAuth.h:493:73: note: passing argument to parameter '
completion' here
    - (void)signInAnonymouslyWithCompletion:(nullable FIRAuthResultCallback)completion;
                                                                            ^
    /Users/marcandrew/Development/apps/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/ios/Classes/FirebaseAuthPlugin.m:89:29: error: incompatible block pointer types sending '
void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')
                     completion:^(FIRAuthDataResult *authResult, NSError *error) {
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /Users/marcandrew/Development/apps/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/ios/Classes/FirebaseAuthPlugin.m:7:
    In file included from /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Private/Firebase/Firebase.h:13:
    In file included from /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Public/FirebaseAuth/FirebaseAuth/FirebaseAuth.h:4:
    /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Public/FirebaseAuth/FirebaseAuth/FIRAuth.h:590:61: note: passing argument to parameter '
completion' here
                     completion:(nullable FIRAuthResultCallback)completion;
                                                                ^
    /Users/marcandrew/Development/apps/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/ios/Classes/FirebaseAuthPlugin.m:126:25: error: incompatible block pointer types sending '
void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')
                 completion:^(FIRAuthDataResult *authResult, NSError *error) {
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /Users/marcandrew/Development/apps/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/ios/Classes/FirebaseAuthPlugin.m:7:
    In file included from /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Private/Firebase/Firebase.h:13:
    In file included from /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Public/FirebaseAuth/FirebaseAuth/FirebaseAuth.h:4:
    /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Public/FirebaseAuth/FirebaseAuth/FIRAuth.h:372:57: note: passing argument to parameter '
completion' here
                 completion:(nullable FIRAuthResultCallback)completion;
                                                            ^
    /Users/marcandrew/Development/apps/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/ios/Classes/FirebaseAuthPlugin.m:195:31: error: incompatible block pointer types sending '
void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')
                       completion:^(FIRAuthDataResult *authResult, NSError *error) {
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /Users/marcandrew/Development/apps/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/ios/Classes/FirebaseAuthPlugin.m:7:
    In file included from /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Private/Firebase/Firebase.h:13:
    In file included from /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Public/FirebaseAuth/FirebaseAuth/FirebaseAuth.h:4:
    /Users/marcandrew/Development/apps/flutter_auth/ios/Pods/Headers/Public/FirebaseAuth/FirebaseAuth/FIRAuth.h:537:63: note: passing argument to parameter '
completion' here
                       completion:(nullable FIRAuthResultCallback)completion;
                                                                  ^
    /Users/marcandrew/Development/apps/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/ios/Classes/FirebaseAuthPlugin.m:283:62: warning: implicit conversion loses integer precision: '
long' to 'int' [-Wshorten-64-to-32]
      userData[@"lastSignInTimestamp"] = [NSNumber numberWithInt:lastSignInDate];
                                         ~                       ^~~~~~~~~~~~~~
    1 warning and 4 errors generated.


Could not build the application for the simulator.
Error launching application on iPhone XS.


[✓] Flutter (Channel beta, v1.2.1, on Mac OS X 10.14.3 18D109, locale en-GB)
    • Flutter version 1.2.1 at /Users/marcandrew/Development/apps/flutter
    • Framework revision 8661d8aecd (3 weeks 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/marcandrew/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.5.0

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 33.1.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.24.0

[✓] Connected device (1 available)
    • iPhone XS • B3DABA61-EB96-43FF-BA78-CEF7B37257BD • ios • iOS 12.1 (simulator)

• No issues found!
Process finished with exit code 0


Can any help please?

Thanks

Marc Andrew

unread,
Mar 9, 2019, 5:09:01 PM3/9/19
to Flutter Dev
Alright, in case someone have the issue in the future. I managed to fix the issue by fallowing the steps from https://github.com/flutter/flutter/issues/17721 

See also https://github.com/flutter/flutter/issues/17951
Reply all
Reply to author
Forward
0 new messages