I want to add new users in a activity and then add to Firebase authentication.
my code is this:
oncreate method
mAuth1 = FirebaseAuth.getInstance();
FirebaseOptions firebaseOptions = new FirebaseOptions.Builder()
.setDatabaseUrl("https://gogamification-a47c8.firebaseio.com/")
.setApiKey("AIzaSyAvwdm930yvxdpcGUNTvIqHDK7WlQZuqOY")
.setApplicationId("1:635406806183:android:dd81a8e31701747e").build();
FirebaseApp myApp = FirebaseApp.initializeApp(getApplicationContext(),firebaseOptions,
"GoGamification2");
mAuth2 = FirebaseAuth.getInstance(myApp);
add user method
mAuth2.createUserWithEmailAndPassword(email.toString(), pass);
I add users to my firebase database very well. When i click the button add user it adds the user in my firebase database and it goes back to my UsersActivity where i have a list of users and a button to add more. ut then when i click the button to add a new user it gives me this error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tsiw.gogamification/com.tsiw.gogamification.AdicionarMembrosActitity}: java.lang.IllegalStateException: FirebaseApp name GoGamification2 already exists!