【发布时间】:2021-03-16 19:24:15
【问题描述】:
升级到 NS 7 并在 xcode 中构建后出现错误。我可以从 CLI 成功构建,运行应用程序,一切都很好,但是当我在 xCode 中构建并在物理设备或模拟器上运行并尝试登录时,我收到了这个错误。
在日志输出中 self = (SAMKeychainQuery*) 和 password = (NSSTRING *) nil 所以它没有获取密码值但是为什么从 CLI 而不是 Xcode 构建时它可以访问它?
我正在运行“@nativescript/core”:“^7.0.13”、“@nativescript/ios”:“7.0.6”、Xcode 12。
这是我的密码文本字段:
<TextField
:isEnabled="!processing"
ref="password"
class="input placeholderColor"
hint="Password"
secure="true"
v-model="user.password"
@loaded="passwordTextField"
:returnKeyType="isLoggingIn ? 'done' : 'next'"
fontSize="18"
/>
//login function
async login(user) {
try {
console.log("in login() in authservice")
const loginRequest = await firebase.login({
type: firebase.LoginType.PASSWORD,
passwordOptions: {
email: user.email,
password: user.password,
},
});
const handleLogin = await this.handleLogin(loginRequest);
return handleLogin;
} catch (error) {
return error;
}
}
当我从 Xcode 构建时,我的 login() 函数甚至没有触发,但在 CLI 中一切正常。
【问题讨论】:
-
你可以尝试用
nativescript-vue/vue-cli-template创建一个空白项目吗?这样您就可以确保安装正确。 -
@cemkaan 是的,新项目构建良好,甚至这个项目构建良好,直到我尝试登录时才会发生错误。此外,这是一个正在生产中的项目,因此它已经运行了一年,并且从 CLI 构建时运行良好。我只有在xcode中构建时无法登录。
标签: nativescript nativescript-vue