After a successful basic authentication I want to add an account for later use. When I tried to create this account using the following code:
AccountManager
In my case it was happening that I had another app installed on the device with the same account name and type, but with different signing cert that the one I was trying to install.
So it was crashing the app.
Checking the android doc for the method addAccountExplicity, it says:
This method requires the caller to have a signature match with the authenticator that owns the specified account.
That was my problem