[flutter/phone_auth][firebase_auth/internal-error] 发生内部错误,打印并检查错误详细信息以获取更多信息

问题描述 投票:0回答:1

我正在使用 firebase 的电话身份验证,从昨天开始它工作得很好。所有用户均无法登录。因此,我们收到了此问题的报告。当我在登录时调试它时,日志显示:

[firebase_auth/internal-error] An internal error has occurred, print and inspect the error details for more information.

这是执行此操作的代码:

void onSubmit(BuildContext context) async {
    final form = formKey.currentState!;
    form.saveAndValidate();

    final phone = form.value[_FormKeys.phone] as String?;
    if (phone == null) return;

    FocusScope.of(context).unfocus();

    final result = await AppFormValidator.lazyPhone(phone, country);
    invalidPhone = result == null;
    notifyListeners();

    WidgetsBinding.instance.addPostFrameCallback((_) async {
      final isValid = formKey.currentState!.saveAndValidate();
      if (!isValid) return;

      loading = true;
      notifyListeners();

      await FirebaseAuth.instance.verifyPhoneNumber(
        phoneNumber: result!.e164,
        timeout: 60.seconds,
        verificationCompleted: (PhoneAuthCredential credential) async {},
        verificationFailed: (FirebaseAuthException e) {
          final message = FireAuth.exceptionMessage(e.code);
          Crashlytics.recordEvent(e, e.stackTrace);
          SnackBars.failure(context, message);
          loading = false;
          notifyListeners();
        },
        codeSent: (String verificationId, int? resendToken) {
          loading = false;
          AppRoutes.loginVerify.push(context, arguments: {
            'verificationId': verificationId,
            'phoneNumber': phone,
            'countryCode': result.countryCode,
          });
        },
        codeAutoRetrievalTimeout: (String verificationId) {},
      );
      loading = false;
    });
  }

我尝试过的解决方案

pubspec.yaml 中的包

与 firebase 相关:

  # firebase
  firebase_core: ^2.27.0
  firebase_auth: ^4.17.5
  cloud_firestore: ^4.15.0
  firebase_storage: ^11.6.1
  firebase_crashlytics: ^3.4.10
  firebase_dynamic_links: ^5.4.9
  geoflutterfire2: ^2.3.15

  # notifications
  firebase_messaging: ^14.7.11
  flutter_local_notifications: ^17.0.0

颤动医生

[✓] Flutter (Channel stable, 3.19.4, on macOS 14.2.1 23C71 darwin-arm64, locale en-PK)
    • Flutter version 3.19.4 on channel stable at /Users/hamza/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 68bfaea224 (2 days ago), 2024-03-20 15:36:31 -0700
    • Engine revision a5c24f538d
    • Dart version 3.3.2
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/hamza/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/hamza/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/hamza/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.87.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0

[✓] Connected device (3 available)
    • iPhone 15 Pro Max (mobile) • A429608D-6879-4980-BD58-24268661A337 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 14.2.1 23C71
      darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 123.0.6312.58

[✓] Network resources
    • All expected network resources are available.

• No issues found!

如果需要其他东西,请告诉我,我会更新问题,但我真的需要解决它,因为它是我们的产品应用程序,并且正在崩溃:/

flutter firebase google-cloud-platform firebase-authentication
1个回答
0
投票

不确定这里发生了什么,但我也遇到了同样的问题,只是@react-native-firebase/auth。我正在用

await auth().sendSignInLinkToEmail(email, actionCodeSettings);
© www.soinside.com 2019 - 2024. All rights reserved.