【问题标题】:Building app on ios when using firebase-auth causes a problem with flutter使用 firebase-auth 时在 ios 上构建应用程序会导致颤振问题
【发布时间】:2020-04-14 23:46:41
【问题描述】:

我正在制作一个使用 firestore 和 firebase_auth 的应用,并且在使用 android 时效果很好,但是当我在 ios 上构建它时,它会导致一系列问题:

 error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to
    parameter of type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)')
                                                 completion:^(FIRUser *user, NSError *error) {
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 note: passing argument to parameter 'completion' here
                      completion:(nullable FIRAuthDataResultCallback)completion;
error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to
    parameter of type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)')
                                                 completion:^(FIRUser *user, NSError *error) {
note: passing argument to parameter 'completion' here
                      completion:(nullable FIRAuthDataResultCallback)completion;
 error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to
    parameter of type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)')
                                                 completion:^(FIRUser *user, NSError *error) {
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 note: passing argument to parameter 'completion' here
                      completion:(nullable FIRAuthDataResultCallback)completion;
warning: 'fetchProvidersForEmail:completion:' is deprecated: Please use
    fetchSignInMethodsForEmail:completion: for Objective-C or fetchSignInMethods(forEmail:completion:) for Swift instead. [-Wdeprecated-declarations]
            fetchProvidersForEmail:email
note: 'fetchProvidersForEmail:completion:' has been explicitly marked deprecated here
    DEPRECATED_MSG_ATTRIBUTE("Please use fetchSignInMethodsForEmail:completion: for Objective-C or "
error: incompatible block pointer types sending 'void (^)(NSError * _Nullable __strong)' to parameter of
    type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)')
                              completion:^(NSError *_Nullable error) {
note: passing argument to parameter 'completion' here
                              completion:(nullable FIRAuthDataResultCallback)completion;
error: incompatible block pointer types sending 'void (^)(NSError * _Nullable __strong)' to parameter of
    type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)')
                              completion:^(NSError *_Nullable error) {

如果需要此信息,我正在使用 firebase_auth 0.6.6。

【问题讨论】:

  • 应用程序将无法构建,这些错误出现在命令行中。但是,该应用可以在 Android 上正常运行

标签: ios firebase flutter dart firebase-authentication


【解决方案1】:

我发现了这个问题。出于某种原因,这发生在我身上,因为我的项目中有 firestore 和 firebase_auth,所以对于 android,我使用了两个插件的一个版本,但在处理 iOS 时我需要这些插件的不同版本。

【讨论】:

    猜你喜欢
    • 2021-10-23
    • 2020-07-03
    • 2020-08-12
    • 1970-01-01
    • 2020-06-13
    • 2019-06-03
    • 1970-01-01
    • 2021-01-05
    • 2021-03-01
    相关资源
    最近更新 更多