简体   繁体   English

FIRAuth.auth()编译错误:“无法对非可选值'FIRAuth'使用可选链接”

[英]FIRAuth.auth() compiling error: “Cannot use optional chaining on non optional value 'FIRAuth'”

Cannot use optional chaining on non optional value 'FIRAuth' 无法在非可选值“ FIRAuth”上使用可选链接

I have tested every solutions, but always got the same error. 我已经测试了每种解决方案,但始终会遇到相同的错误。 Even if i create a new project, when i'm using FIRAuth, i always got a compiling error. 即使我创建一个新项目,当我使用FIRAuth时,总是会出现编译错误。

Can someone help me please. 有人能帮助我吗。 I use Swift 2, Xcode 7, IOS9 我使用Swift 2,Xcode 7,IOS9

If you are trying to add FIRAuth.auth()? 如果您要添加FIRAuth.auth()? try to remove (?). 尝试删除(?)。

FIRAuth.auth() is non optional so treating them as one might result to the error “Cannot use optional chaining on non optional value 'FIRAuth'” FIRAuth.auth()是非可选的,因此将它们视为一个可能会导致错误“无法在非可选值'FIRAuth'上使用可选链接”

Optional chaining is a process for querying and calling properties, methods, and subscripts on an optional that might currently be nil 可选链接是一个查询和调用当前可能为零的可选属性,方法和下标的过程

Check Optional Chaining 检查可选链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用 Firebase 身份验证:FIRAuth.auth 不起作用 - Cannot use Firebase authentication: FIRAuth.auth does not work 不能对“Auth”类型的非可选值使用可选链 - Cannot use optional chaining on non-optional value of type 'Auth' FIRAuth.auth()?. createUser不会创建用户 - FIRAuth.auth()?.createUser does not create user 不能对类型为“[Int]”的非可选值使用可选链 - Cannot use optional chaining on non-optional value of type '[Int]' 不能对“ViewController”类型的非可选值使用可选链接 - Cannot use optional chaining on non-optional value of type 'ViewController' Firebase-iOS Swift:FIRAuth.auth()。signOut()未注销当前用户 - Firebase - iOS Swift: FIRAuth.auth().signOut() not signing out current user 使用FIRAuth.auth()?. signIn(withEmail进行登录后,GIDSignIn.sharedInstance()。hasAuthInKeychain()为null - After logging with FIRAuth.auth()?.signIn(withEmail , GIDSignIn.sharedInstance().hasAuthInKeychain() is null 'auth()'不可用:使用对象构造'FIRAuth()' - 'auth()' is unavailable : use object construction 'FIRAuth()' 不能在“任何”SWIFT类型的非可选值上使用可选链接 - cannot use optional chaining on non-optional value of type 'Any' SWIFT 从 FIRAuth swift 获取值 - get value from FIRAuth swift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM