Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Chain validation failed" in Android Studio with Firebase

When I try to run the java android Code in debug mode

@Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);
       Firebase.setAndroidContext(this);
       Firebase firebase = new Firebase("https://androidcookbook-98385.firebaseio.com");
       firebase.createUser("[email protected]", "mypassword", new Firebase.ValueResultHandler<Map<String, Object>>(){

           @Override
           public void onSuccess(Map<String, Object> stringObjectMap) {
               Log.i("Firebase", "successfully created user user account with uid:"+ stringObjectMap.get("uid") );
           }

           @Override
           public void onError(FirebaseError firebaseError) {
               Log.i("Firebase", "Error on creating user!!!! "+firebaseError.getMessage());
           }
       });
   }

I get the error

There was an exception while performing the request: Chain validation failed

I have tried to add the SHA1 code from Gradle > app > Tasks > Signing Report to the Firebase main project configuration .

I still get the previous error The Gradle console gives me only a debug sha1!!!

like image 867
Jean-Pierre Mena Avatar asked May 10 '26 09:05

Jean-Pierre Mena


2 Answers

I had a similar problem with Firebase in a Flutter app. The API returned:

com.google.firebase.FirebaseException: An internal error has occurred. [ Chain validation failed ]

It turned out to be the date and time on my Android Emulator was completely out. A cold boot reset the date and time and the Firebase exception issue was solved.

like image 99
Luke Avatar answered May 12 '26 23:05

Luke


I had similar issue in flutter. You should reset your time and timezone on the mobile device or simulator. It worked for me.

like image 27
kevin dobariya Avatar answered May 13 '26 01:05

kevin dobariya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!