Search Unity

App crashes after FirebaseAuth.DefaultInstance

Discussion in 'Android' started by swifter14, Oct 23, 2018.

  1. swifter14

    swifter14

    Joined:
    Mar 2, 2017
    Posts:
    165
    I use FireBase authentication with a simple function that signs up a new user, it works great on the Unity Editor, but when I build it on my Android, it crashes the second it tries to read this line- FirebaseAuth auth = FirebaseAuth.DefaultInstance

    This is the error I get before it crashes-
    Java class com/google/firebase/auth/FirebaseAuthWebException not found. Please verify the AAR which contains the com/google/firebase/auth/FirebaseAuthWebException class is included in your app.
    1. Why do I even get the Firebase-AuthWeb-Exception ?
    2. Why can't it find that exception? (I tried to resolve jar files, and to re-import auth SDK but it didn't solve the issue
    My app is simple- there's a SignUp button that calls this function-

    Code (CSharp):
    1. public void SignUp()
    2. {
    3.     FirebaseAuth auth = FirebaseAuth.DefaultInstance;  //The error is after this line
    4.  
    5.     auth.CreateUserWithEmailAndPasswordAsync(email.text, password.text).ContinueWith(task =>
    6.     {
    7.         if (task.IsCanceled)
    8.         {
    9.             Debug.LogError("CreateUserWithEmailAndPasswordAsync was canceled.");
    10.             return;
    11.         }
    12.         if (task.IsFaulted)
    13.         {
    14.             Debug.LogError("CreateUserWithEmailAndPasswordAsync encountered an error: " + task.Exception);
    15.             return;
    16.         }
    17.  
    18.         // Firebase user has been created.
    19.         Firebase.Auth.FirebaseUser newUser = task.Result;
    20.  
    21.  
    22.         Debug.LogFormat("Firebase user created successfully: {0} ({1})",
    23.             newUser.DisplayName, newUser.UserId);
    24.        // SignInWithVerification();
    25.     });
    26.  
    27.  
    28. }
    • Unity- 2108.2.12f1
    • Build system- Gradle
    • Firebase unity sdk 5.4.0 dotnet3
     
    Chuck-SquareTwo likes this.
  2. temelal

    temelal

    Joined:
    Apr 15, 2016
    Posts:
    1
    Hello,
    I have same problem.
    Could you find a solution?
    thanks.
     
  3. ConcanoPayno

    ConcanoPayno

    Joined:
    Mar 27, 2017
    Posts:
    1