为啥我的应用显示名为 __FIRAPP_DEFAULT 的应用不存在
Posted
技术标签:
【中文标题】为啥我的应用显示名为 __FIRAPP_DEFAULT 的应用不存在【英文标题】:Why my app is showing App with name __FIRAPP_DEFAULT does not exist为什么我的应用显示名为 __FIRAPP_DEFAULT 的应用不存在 【发布时间】:2019-12-07 15:10:32 【问题描述】:我正在使用 frebase 开发 Flutter ios 应用程序。我想使用短信验证登录应用程序。当我运行应用程序时,它正在从 db 获取详细信息。但它显示应用程序启动时间错误。
错误是
- [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
在 xcode 中,我启用了启用的“推送通知”和“远程通知”以在 OTP 验证中删除验证码。
但如果我禁用“推送通知”和“远程通知”,它将显示验证码。并在验证验证码后发送短信。
- [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
在应用程序中打开。
我在 main.dart 文件下面给出了
final FirebaseApp app = await FirebaseApp.configure(
name: myApp,
options: const FirebaseOptions(
googleAppID: '1:57979xxxxx:ios:c9d1031xx',
gcmSenderID: '58989xxxxx6',
apiKey: 'AIzaSyANwavsssasxxxxxxxxxxxKBNF7I',
projectID: 'myApp',
),
);
短信验证码是
await firebaseAuth.verifyPhoneNumber(
phoneNumber: "+91"+phoneNumber,
timeout: Duration(seconds: timeOut),
codeAutoRetrievalTimeout: autoRetrieve,
codeSent: smsCodeSent,
verificationCompleted: verifiedSuccess,
verificationFailed: veriFailed);
final PhoneVerificationFailed veriFailed = (AuthException exception)
print("ERROR");
print('$exception.message');
throw new Exception(exception);
;
当我启用“推送通知”和“远程通知”时
它将在“veriFailed”函数中显示错误。错误是
Invalid Token
和
PlatformException(ERROR_MISSING_VERIFICATION_ID, The phone auth credential was created with an empty verification ID., null)
info.plist 是
<?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>APS Environment</key>
<string>production</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>My App</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>My App</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb3xxxxxxxxx</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.xxxxxxxxxxxxxxx</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.myapp.app</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>FacebookAppID</key>
<string>334xxxxxxxx</string>
<key>FacebookDisplayName</key>
<string>My App</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This application requires location services to work</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This application requires location services to work</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This application requires location services to work</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>io.flutter.embedded_views_preview</key>
<true/>
</dict>
</plist>
我的pubspec.yaml
是
firebase_core: ^0.4.0+8
firebase_auth: ^0.11.1+11
cloud_firestore: ^0.12.7
firebase_messaging: ^5.1.2
我不知道如何解决这个问题,请帮助我。
【问题讨论】:
巧合?从过去的 1 小时开始,我也面临着这个问题。 我最近 3 天都面临着 【参考方案1】:在插件之前调用 AppDelegate.swift 到 FirebaseApp 中的换行。
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
【讨论】:
【参考方案2】:我通过将 auth
插件更改为来解决
firebase_auth:
git:
url: https://github.com/collinjackson/plugins.git
ref: 441417c2fed0ff26bf84a49ab2c5ffd2aa5487de
path: packages/firebase_auth
添加插件后问题解决。插件firebase_auth: ^0.11.1+11
造成问题
【讨论】:
以上是关于为啥我的应用显示名为 __FIRAPP_DEFAULT 的应用不存在的主要内容,如果未能解决你的问题,请参考以下文章
为啥我的应用程序使用 __autoreleasing + __strong 会崩溃?
为啥 __nss_database_lookup 在我的数字 C++ 程序中占用大部分时间