gpt4 book ai didi

java - 编译应用程序使用或覆盖已弃用的 API 时出错

转载 作者:行者123 更新时间:2023-12-02 00:52:36 24 4
gpt4 key购买 nike

当我编译应用程序时,它显示错误应用程序使用或覆盖已弃用的 API

mEmailView =  findViewById(R.id.login_email);

mPasswordView = findViewById(R.id.login_password);
googleButton = findViewById(R.id.google_button);

mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
if (id == R.integer.login || id == EditorInfo.IME_NULL) {
attemptLogin();
return true;
}
return false;
}
});
textView3 = findViewById(R.id.textView3);

String text = "<font color=#cc0029>S</font><font color=#37BAF5>U</font><font color=#E000EE>M</font><font color=#BF0731>O</font>";
textView3.setText(Html.fromHtml(text));
textView3.setScaleX(2.5f);

// instance of FirebaseAuth



}


public void signInExistingUser(View v) {
// Call attemptLogin() here
attemptLogin();

}



public void registerNewUser(View v) {
Intent intent = new Intent(this, com.one4all.sumotwo.RegisterActivity.class);
finish();
startActivity(intent);
}



private void attemptLogin() {
String email = mEmailView.getText().toString();
String password = mPasswordView.getText().toString();
if (email.equals("") || password.equals("")) {
return;
} else {
Toast.makeText(this, "Login progress...", Toast.LENGTH_SHORT).show();

}
//FirebaseAuth to sign in with email and password
firebaseAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (!task.isSuccessful()) {
showError("Problem in sign in");
} else {

Intent intent = new Intent(LoginActivity.this, BottomNavigation.class);
finish();
startActivity(intent);
}
}
});

错误

尝试访问方法引起:java.lang.IllegalAccessError:尝试访问方法 com.google.common.io.Files.fileTreeTraverser()Lcom/google/common/collect/TreeTraverser;来自 com.android.build.gradle.internal.transforms.InstantRunVerifierTransform 类 在com.android.build.gradle.internal.transforms.InstantRunVerifierTransform.processFolderInputs(InstantRunVerifierTransform.java:165) 在com.android.build.gradle.internal.transforms.InstantRunVerifierTransform.doTransform(InstantRunVerifierTransform.java:139) 在 com.android.build.gradle.internal.transforms.InstantRunVerifierTransform.transform(InstantRunVerifierTransform.java:120)

最佳答案

更新android studio后它就可以工作了。这是链接https://docs.gradle.org/current/userguide/upgrading_version_4.html

关于java - 编译应用程序使用或覆盖已弃用的 API 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57845779/

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