gpt4 book ai didi

java - 任务显示的 Firebase AuthResult 无法解析符号

转载 作者:行者123 更新时间:2023-11-30 06:51:23 24 4
gpt4 key购买 nike

任务上出现红线。我也导入了 import com.google.firebase.auth.AuthResult;,但它也显示 cannot resolve symbol authresult

    auth = FirebaseAuth.getInstance();
sign_up_button = (Button) findViewById(R.id.sign_up_button);
email = (EditText) findViewById(R.id.email);
password = (EditText) findViewById(R.id.password);
sign_up_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String email_a = email.getText().toString().trim();
String password_a = password.getText().toString().trim();
//create user
auth.createUserWithEmailAndPassword(email_a, password_a)
.addOnCompleteListener(RegisterStaff.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Toast.makeText(RegisterStaff.this, "Registration Complete..:" + task.isSuccessful(), Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.GONE);
// If sign in fails, display a message to the user. If sign in succeeds
// the auth state listener will be notified and logic to handle the
// signed in user can be handled in the listener.
if (!task.isSuccessful()) {
Toast.makeText(RegisterStaff.this, "Registration failed..." + task.getException(),
Toast.LENGTH_SHORT).show();
} else {
startActivity(new Intent(RegisterStaff.this, StaffLogin.class));
finish();
}
}
}
);}
});
}
@Override
protected void onResume() {
super.onResume();
progressBar.setVisibility(View.GONE);
}

最佳答案

确保你编译的 authresult 版本与核心版本相同:-

编译 'com.google.firebase:firebase-core:10.0.1'

编译 'com.google.firebase:firebase-database:10.0.1'

编译 'com.google.firebase:firebase-messaging:10.0.1'

编译 'com.google.firebase:firebase-auth:10.0.1'

都是一样的 10.0.1

关于java - 任务显示的 Firebase AuthResult 无法解析符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40224942/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com