title: Getting "FirebaseApp name AnyAppName already exists" when creating user without signing in
body: <p>I want Admins to create users. But this will be on the client side as there will be many admins and I don't want that many people to have access to my firebase console. That's why I don't want to use Firebase-Admin SDK.</p>
  
  <p>I have searched many places and found this. Below is that code:</p>
  
  <p>So you can create two different FirebaseAuth objects like:</p>
  
  <p><code>private FirebaseAuth mAuth1;
  private FirebaseAuth mAuth2;</code></p>
  
  <p>Now in the onCreate you can initialize them as:</p>
  
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_register);
  
          mAuth1 = FirebaseAuth.getInstance();
  
          FirebaseOptions firebaseOptions = new FirebaseOptions.Builder()
                  .setDatabaseUrl("[Database_url_here]")
                  .setApiKey("Web_API_KEY_HERE")
                  .setApplicationId("PROJECT_ID_HERE").build();
  
          FirebaseApp myApp = FirebaseApp.initializeApp(getApplicationContext(),firebaseOptions,
                  "AnyAppName");
  
          mAuth2 = FirebaseAuth.getInstance(myApp);
  //..... other code here
  }
  </code></pre>
  
  <p>To get ProjectID, WebAPI key you can go to Project Settings in your firebase project console.</p>
  
  <p>Now to create the user account you have to use <code>mAuth2</code>, not <code>mAuth1</code>. And then on successful registration, you can log out that <code>mAuth2</code> user.</p>
  
  <p>Example:</p>
  
  <pre><code>private void createAccount(String email, String password)
      {
          mAuth2.createUserWithEmailAndPassword(email, password)
                  .addOnCompleteListener(this, new OnCompleteListener&lt;AuthResult&gt;() {
                      @Override
                      public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
  
  
                          if (!task.isSuccessful()) {
                              String ex = task.getException().toString();
                              Toast.makeText(RegisterActivity.this, "Registration Failed"+ex,
                                      Toast.LENGTH_LONG).show();
                          }
                          else
                          {
                              Toast.makeText(RegisterActivity.this, "Registration successful",
                                      Toast.LENGTH_SHORT).show();
                              mAuth2.signOut();
                          }
  
  
  
                          // ...
                      }
                  });
  
      }
  </code></pre>
  
  <p>But here I am able to create users but only once. After that I am not able to reopen that activity again. It is showing "FirebaseApp name AnyAppName already exists!".</p>