Пользователь успешно зарегистрирован и в LoginActivity после заполнения данных пользователя при аутентификации он выдает
"Не удалось отправить REMS-пакет DDMS в отладчик (-1 из 20): Сломанный канал"
Ошибка в LogCat.
signup.java -> signUP_btn ClickListener
public void signingup(View view) {
uid = findViewById(R.id.userbox);
repwd = findViewById(R.id.repwd);
mail = findViewById(R.id.mail);
pwd = findViewById(R.id.pwd);
mylayout = findViewById(R.id.signuplayout);
String username = uid.getText().toString();
String password = pwd.getText().toString();
String rePassword = repwd.getText().toString();
String email = mail.getText().toString();
if (username.equals("")) {
Toast.makeText(this, "Invalid Username!!", Toast.LENGTH_LONG).show();
} else if (password.equals("")) {
Toast.makeText(this, "Invalid Password!!", Toast.LENGTH_LONG).show();
} else if (!password.equals(rePassword)) {
Toast.makeText(this, "Password should Match!!", Toast.LENGTH_LONG).show();
} else if (email.equals("")) {
Toast.makeText(this, "Invalid Email Id!!", Toast.LENGTH_LONG).show();
} else {
firebaseAuth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
try {
//check if successful
if (task.isSuccessful()) {
//User is successfully registered and logged in
//start Profile Activity here
Toast.makeText(signup.this, "registration successful",
Toast.LENGTH_SHORT).show();
finish();
startActivity(new Intent(getApplicationContext(), LoginActiviity.class));
}else{
Log.d("Error", ": "+task.getException().toString());
Toast.makeText(signup.this, "Couldn't register, try again",
Toast.LENGTH_SHORT).show();
}
}catch (Exception e){
e.printStackTrace();
}
}
});
}
}
LoginActivity.java
public class LoginActiviity extends AppCompatActivity {
TextView welcome,signsub,signText,reset;
EditText user,pwd;
Button signing;
ImageView loginLogo;
Animation anim,headtext,body_text,body_text2,body_text3;
private FirebaseAuth firebaseAuth;
private FirebaseUser currentUser;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_activiity);
Typeface MRegular = Typeface.createFromAsset(getAssets(),"fonts/MRegular.ttf");
Typeface MMedium = Typeface.createFromAsset(getAssets(),"fonts/MMedium.ttf");
Typeface MLight = Typeface.createFromAsset(getAssets(),"fonts/MLight.ttf");
welcome= findViewById(R.id.welcome);
signsub= findViewById(R.id.signsub);
signText= findViewById(R.id.signText);
reset= findViewById(R.id.reset);
user= findViewById(R.id.userbox);
pwd= findViewById(R.id.pwd);
signing= findViewById(R.id.signBtn);
loginLogo= findViewById(R.id.login_logo);
welcome.setTypeface(MRegular);
signsub.setTypeface(MLight);
signText.setTypeface(MMedium);
reset.setTypeface(MLight);
user.setTypeface(MLight);
pwd.setTypeface(MLight);
signing.setTypeface(MMedium);
anim= AnimationUtils.loadAnimation(this,R.anim.sm_tobig);
loginLogo.startAnimation(anim);
headtext= AnimationUtils.loadAnimation(this,R.anim.head_text);
welcome.startAnimation(headtext);
signsub.startAnimation(headtext);
body_text= AnimationUtils.loadAnimation(this,R.anim.body_text);
body_text2= AnimationUtils.loadAnimation(this,R.anim.body_text2);
body_text3= AnimationUtils.loadAnimation(this,R.anim.body_text3);
user.startAnimation(body_text);
pwd.startAnimation(body_text2);
signing.startAnimation(body_text3);
reset.startAnimation(body_text3);
firebaseAuth= FirebaseAuth.getInstance();
reset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(LoginActiviity.this,signup.class);
startActivity(intent);
}
});
}
public void signingin(View view) {
user = findViewById(R.id.userbox);
pwd = findViewById(R.id.pwd);
String Email = user.getText().toString().trim();
String Password = pwd.getText().toString().trim();
firebaseAuth.signInWithEmailAndPassword(Email, Password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()){
currentUser = firebaseAuth.getCurrentUser();
Log.d("Error", "onComplete: "+task.toString()+currentUser);
startActivity(new Intent(getApplicationContext(),
RecyclerView.class));
}else {
Toast.makeText(LoginActiviity.this, "couldn't login",
Toast.LENGTH_SHORT).show();
}
}
});
}
}
Здесь, в LoginActivity, используется ящик пользователя для электронной почты.