Flatter应用程序在firebase电话身份验证时崩溃

Flatter应用程序在firebase电话身份验证时崩溃,firebase,flutter,firebase-authentication,Firebase,Flutter,Firebase Authentication,我正在开发一个flatter应用程序,在该应用程序中,我尝试使用Firebase电话身份验证对用户进行身份验证 根据Firebase策略,调试时无法获取身份验证代码,因此我必须使用预定义代码将我的电话号码添加到Firebase控制台 现在它在调试时工作正常,但当我在发布模式下使用它时,当Google Play服务验证手机时,我的应用程序崩溃了。但是,当我再次打开应用程序时,它已通过身份验证,工作正常。如何调试此崩溃 这是我的密码 signInWithPhone(String phone) {

我正在开发一个flatter应用程序,在该应用程序中,我尝试使用Firebase电话身份验证对用户进行身份验证

根据Firebase策略,调试时无法获取身份验证代码,因此我必须使用预定义代码将我的电话号码添加到Firebase控制台

现在它在调试时工作正常,但当我在发布模式下使用它时,当Google Play服务验证手机时,我的应用程序崩溃了。但是,当我再次打开应用程序时,它已通过身份验证,工作正常。如何调试此崩溃

这是我的密码

  signInWithPhone(String phone) {
    _authStatus = AuthStatus.Authenticating;
    notifyListeners();
    try {
      _auth.verifyPhoneNumber(
          phoneNumber: phone,
          timeout: Duration(seconds: 60),
          verificationCompleted: (AuthCredential _authCredential) {
            _getFirebaseUser(_authCredential);
            print("verificationCompleted: ${_authCredential.providerId}");
          },
          verificationFailed: (AuthException authException) {
            print("Auth Failed: ${authException.message}");
            _authStatus = AuthStatus.Uninitialized;
            notifyListeners();
          },
          codeSent: (String verificationId, [int forceResendingToken]) {
            this.verificationId = verificationId;
            print("Code Sent: $verificationId");
            _authStatus = AuthStatus.CodeSent;
            notifyListeners();
          },
          codeAutoRetrievalTimeout: (String verificationId) {
            this.verificationId = verificationId;
            print("Actual Code: $verificationId");
          });
    } catch (e) {
      print(e.toString());
    }
  }


  void _getFirebaseUser(AuthCredential authCredential) async {
    try {
      AuthResult authResult =
          await _auth.signInWithCredential(authCredential).catchError((e) {
        print(e.toString());
      });
      _firebaseUser = authResult.user;
      notifyListeners();
    } catch (e) {
      print(e.toString());
      _authStatus = AuthStatus.Uninitialized;
      notifyListeners();
    }
  }

您可以使用Logcat获取崩溃日志我如何获取发布应用程序的日志?它在可调试应用程序中不可见。您可以进行筛选,但在Logcat的搜索栏中键入您的捆绑包id您可以使用Logcat获取崩溃日志我如何获取发布应用程序的日志?它在可调试应用程序中不可见。您可以进行筛选,但可以在logcat的搜索栏中键入捆绑包id