首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ReferenceError: FIRAuth

ReferenceError: FIRAuth
EN

Stack Overflow用户
提问于 2019-08-26 19:48:03
回答 1查看 208关注 0票数 0

我目前正在开发一个应用程序使用Nativescript。

对于本地模拟器上的Firebase,一切都很好,但是当我在iPhone上测试应用程序时,会得到以下错误

代码语言:javascript
复制
CONSOLE LOG file:///app/vendor.js:2172:24: Error in firebase.login: ReferenceError: Can't find variable: FIRAuth

我想这可能与我初始化Firebase的位置有关,所以我将firebase.init()app.models.ts移到了第一个视图中,就像在其他论坛文章中看到的那样。

我真的很困惑,为什么这是完美地工作在模拟器上,而不是在我的设备上。

如果有人能给我一点启示那就太棒了。

代码语言:javascript
复制
Stack:
    iPhone SE,
    Nativescript (Angular)
    Firebase
    nativescript-plugin-firebase

如果你需要更多的信息,请不要犹豫。

GoogleService-info.plist

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CLIENT_ID</key>
    <string>xxxxxxxxx.apps.googleusercontent.com</string>
    <key>REVERSED_CLIENT_ID</key>
    <string>com.googleusercontent.apps.xxxxxxxxxxxx</string>
    <key>API_KEY</key>
    <string>xxxxxxxxxxxxxxxxxxxxxxxxxxx</string>
    <key>GCM_SENDER_ID</key>
    <string>xxxxxxxxx</string>
    <key>PLIST_VERSION</key>
    <string>1</string>
    <key>BUNDLE_ID</key>
    <string>org.nativescript.xxxxxxxxx</string>
    <key>PROJECT_ID</key>
    <string>xxxxxxxx</string>
    <key>STORAGE_BUCKET</key>
    <string>xxxxxxxx.appspot.com</string>
    <key>IS_ADS_ENABLED</key>
    <false></false>
    <key>IS_ANALYTICS_ENABLED</key>
    <false></false>
    <key>IS_APPINVITE_ENABLED</key>
    <false></false>
    <key>IS_GCM_ENABLED</key>
    <true></true>
    <key>IS_SIGNIN_ENABLED</key>
    <true></true>
    <key>GOOGLE_APP_ID</key>
    <string>1:xxxxxxxxx:ios:xxxxxxxxx</string>
    <key>DATABASE_URL</key>
    <string>https://xxxxxxxxx.firebaseio.com</string>
</dict>
</plist>

firebase.nativescript.json

代码语言:javascript
复制
{
    "external_push_client_only": false,
    "using_ios": true,
    "using_android": true,
    "firestore": true,
    "realtimedb": true,
    "authentication": true,
    "remote_config": false,
    "performance_monitoring": false,
    "messaging": false,
    "in_app_messaging": false,
    "crashlytics": false,
    "storage": true,
    "functions": false,
    "facebook_auth": false,
    "google_auth": false,
    "admob": false,
    "dynamic_links": false,
    "ml_kit": false
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-08-26 22:41:43

如果使用nativescript-plugin-firebase,似乎无法在物理设备上预览。

您将得到以下错误:

代码语言:javascript
复制
Plugin nativescript-plugin-firebase is not included in preview app on device 3CDExxxx-xxxx-xxxx-xxxx-960121C3xxxx and will not work.

应用程序将运行,但您将无法使用任何Firebase模块。

我希望这对有同样问题的人有帮助。

如果有人知道附近的工作,不需要购买许可证从苹果进行测试,请在评论中让我知道。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57664098

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档