title: Cannot create PhoneAuthCredential without verificationProof?
body: <p>I have followed the guideline of firebase docs to implement login into my app but there is a problem while signup, the app is crashing and the catlog showing the following erros :</p>
  
  <pre><code>Process: app, PID: 12830
      java.lang.IllegalArgumentException: Cannot create PhoneAuthCredential without either verificationProof, sessionInfo, ortemprary proof.
          at com.google.android.gms.common.internal.Preconditions.checkArgument(Unknown Source)
          at com.google.firebase.auth.PhoneAuthCredential.&lt;init&gt;(Unknown Source)
          at com.google.firebase.auth.PhoneAuthProvider.getCredential(Unknown Source)
          at app.MainActivity.verifyPhoneNumberWithCode(MainActivity.java:132)
          at app.MainActivity.onClick(MainActivity.java:110)
          at android.view.View.performClick(View.java:4803)
          at android.view.View$PerformClick.run(View.java:20102)
          at android.os.Handler.handleCallback(Handler.java:810)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:189)
          at android.app.ActivityThread.main(ActivityThread.java:5532)
          at java.lang.reflect.Method.invoke(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:372)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745) 
  </code></pre>
  
  <p>I've tried to see other code examples but they are simmiler to my code but still my app crashes with the same error.</p>
  
  <p>and this is my code i wrote using the guidline of firebase documents :</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements View.OnClickListener {
      private FirebaseAuth mAuth;
      private String mVerificationId;
      private PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallbacks;
      Button login,verify,signout;
      EditText number;
      EditText code;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          mAuth = FirebaseAuth.getInstance();
          login = findViewById(R.id.btnlogin);
          verify = findViewById(R.id.btnverify);
          signout = findViewById(R.id.btnsignout);
          number = findViewById(R.id.editnumber);
          code = findViewById(R.id.editcode);
          login.setOnClickListener(this);
          verify.setOnClickListener(this);
          signout.setOnClickListener(this);
  
          mCallbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
              @Override
              public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
                  signInWithPhoneAuthCredential(phoneAuthCredential);
              }
  
              @Override
              public void onVerificationFailed(FirebaseException e) {
                  Toast.makeText(MainActivity.this, "Error" + e.toString(), Toast.LENGTH_SHORT).show();
                  if (e instanceof FirebaseAuthInvalidCredentialsException) {
                      Toast.makeText(MainActivity.this, "Invalid Request " + e.toString(), Toast.LENGTH_SHORT).show();
                  } else if (e instanceof FirebaseTooManyRequestsException) {
                      Toast.makeText(MainActivity.this, "The SMS quota for the project has been exceeded " + e.toString(), Toast.LENGTH_SHORT).show();
                  }
              }
  
              @Override
              public void onCodeSent(String vId, PhoneAuthProvider.ForceResendingToken forceResendingToken) {
                  Toast.makeText(MainActivity.this, "Code Sent" + vId, Toast.LENGTH_SHORT).show();
                  number.setText("");
                mVerificationId = vId;
              }
          };
      }
  
      private void signInWithPhoneAuthCredential(PhoneAuthCredential phoneAuthCredential) {
          mAuth.signInWithCredential(phoneAuthCredential).addOnCompleteListener(this, new OnCompleteListener&lt;AuthResult&gt;() {
              @Override
              public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
                  if (task.isComplete()){
                      FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
                      String uid = null;
                      if (user != null) {
                          uid = user.getUid();
                      }
                      Toast.makeText(MainActivity.this, "Signed In", Toast.LENGTH_SHORT).show();
                      Toast.makeText(MainActivity.this, uid, Toast.LENGTH_SHORT).show();
                  } else {
                      if (task.getException() instanceof FirebaseAuthInvalidCredentialsException) {
                          Toast.makeText(MainActivity.this, "Invalid Code", Toast.LENGTH_SHORT).show();
                      }
                  }
              }
          });
      }
  
      @Override
      public void onClick(View v) {
          switch (v.getId()) {
              case R.id.btnlogin: {
                  String phonenumber = number.getText().toString();
                  startPhoneNumberVerification(phonenumber);
              }
              case R.id.btnverify: {
                  String vCode = code.getText().toString();
                  verifyPhoneNumberWithCode(mVerificationId, vCode);
              }
              case R.id.btnsignout: {
                  mAuth.signOut();
              }
          }
      }
  
      private void startPhoneNumberVerification(String phoneNumber) {
          PhoneAuthProvider.getInstance().verifyPhoneNumber(phoneNumber, 60, TimeUnit.SECONDS, this, mCallbacks);
      }
  
      private void verifyPhoneNumberWithCode(String verificationId, String code) {
          PhoneAuthCredential credential = PhoneAuthProvider.getCredential(verificationId, code);
          signInWithPhoneAuthCredential(credential);
      }
  
  } 
  </code></pre>
  
  <p>The Above code is sending the otp to the given number but it crashes and cat-log shows the error mentioned above.</p>
  
  <p>Please try to help me to figure out what is the error in my code rather referring to other codes.</p>