You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Firebase邮箱密码登录报错:类型转换不兼容问题求助

Firebase邮箱密码登录报错:类型 'List<Object?>' 不是 'PigeonUserDetails?' 的子类型

解决方案

  • 升级Firebase相关依赖
    这个错误大概率是依赖版本不匹配导致的,尤其是Firebase Auth内部依赖的Pigeon工具版本冲突。直接升级所有Firebase相关依赖即可:

    1. 打开pubspec.yaml,将firebase_auth、firebase_core等Firebase依赖更新到最新稳定版
    2. 执行命令:
      flutter pub upgrade
      flutter pub get
      
    3. 清理项目缓存后重新运行:
      flutter clean
      flutter run
      
  • 验证依赖兼容性
    如果升级后问题依旧,检查firebase_auth与其他Firebase依赖的版本是否兼容,确保没有跨版本的API调用不匹配问题。

错误详情

发生错误:类型 'List<Object?>' 不是类型 'PigeonUserDetails?' 的子类型(类型转换时)
该错误出现前,项目一切运行正常。

涉事登录代码

Future<User?> signInWithEmailAndPasswrod(String email, String password) async{
  try{
    UserCredential credential = await _auth.signInWithEmailAndPassword(email: email, password: password);
    return credential.user;
  }
  catch(err){
    debugPrint("Some Error Occured $err");
  }
  return null;
}

内容的提问来源于stack exchange,提问作者Ayush Tiwari

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 05:03:11