我的应用程序在我的手机小米redmi note 8 pro、redmi 7s、redmi y2和三星f41中运行良好。但它在三星j7 prime和redmi 4启动时崩溃。我在手机上安装了它,在logcat错误部分,我发现了这些错误。
2021-07-26 18:04:36.979 495-3391/? E/ResolverController: No valid NAT64 prefix (121, <unspecified>/0)
2021-07-26 18:04:37.592 1288-1438/? E/WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
2021-07-26 18:04:38.807 531-570/? E/UxUtility: notifyAppState error = NULL
2021-07-26 18:04:38.831 29607-29607/? E/GraphicExt: GraphicExtModuleLoader::CreateGraphicExtInstance false
2021-07-26 18:04:38.865 1731-1731/? E/GraphicExt: GraphicExtModuleLoader::CreateGraphicExtInstance false
2021-07-26 18:04:39.059 495-3440/? E/ResolverController: No valid NAT64 prefix (121, <unspecified>/0)
2021-07-26 18:04:39.059 495-3445/? E/ResolverController: No valid NAT64 prefix (121, <unspecified>/0)
2021-07-26 18:04:39.154 1288-5982/? E/BoostFramework: BoostFramework() : Exception_1 = java.lang.ClassNotFoundException: com.qualcomm.qti.Performance
2021-07-26 18:04:39.154 1288-5982/? E/BoostFramework: BoostFramework() Ux Perf: Exception = java.lang.ClassNotFoundException: com.qualcomm.qti.UxPerformance
2021-07-26 18:04:39.161 1288-1307/? E/system_server: Invalid ID 0x00000000.
2021-07-26 18:04:39.178 1288-1307/? E/GraphicExt: GraphicExtModuleLoader::CreateGraphicExtInstance false
2021-07-26 18:04:39.212 3457-3457/? E/.luteraaesport: Unknown bits set in runtime_flags: 0x8000
2021-07-26 18:04:39.238 531-570/? E/UxUtility: notifyAppState error = NULL
2021-07-26 18:04:40.236 3457-3457/com.luteraa.luteraaesports E/libc: Access denied finding property "ro.vendor.df.effect.conflict"
2021-07-26 18:04:40.432 1288-1525/? E/WindowManager: App trying to use insecure INPUT_FEATURE_NO_INPUT_CHANNEL flag. Ignoring
2021-07-26 18:04:40.460 3457-3457/com.luteraa.luteraaesports E/GraphicExt: Can't load libboost_ext_fwk
2021-07-26 18:04:40.460 3457-3457/com.luteraa.luteraaesports E/GraphicExt: GraphicExtModuleLoader::CreateGraphicExtInstance false
2021-07-26 18:04:40.483 3457-3504/com.luteraa.luteraaesports E/gralloc: Arm Module v1.0
2021-07-26 18:04:40.483 3457-3504/com.luteraa.luteraaesports E/ion: ioctl c0044901 failed with code -1: Invalid argument
2021-07-26 18:04:40.603 1288-1438/? E/WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
2021-07-26 18:04:42.814 7654-16080/? E/memtrack: Couldn't load memtrack module
2021-07-26 18:04:43.610 1288-1438/? E/WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
2021-07-26 18:04:43.764 1288-3120/? E/WindowManager: App trying to use insecure INPUT_FEATURE_NO_INPUT_CHANNEL flag. Ignoring
2021-07-26 18:04:43.801 3457-3457/com.luteraa.luteraaesports E/GraphicExt: GraphicExtModuleLoader::CreateGraphicExtInstance false
2021-07-26 18:04:44.089 495-3438/? E/ResolverController: No valid NAT64 prefix (121, <unspecified>/0)
2021-07-26 18:04:44.149 1288-11289/? E/WindowManager: App trying to use insecure INPUT_FEATURE_NO_INPUT_CHANNEL flag. Ignoring
2021-07-26 18:04:44.219 3457-3457/com.luteraa.luteraaesports E/GraphicExt: GraphicExtModuleLoader::CreateGraphicExtInstance false
2021-07-26 18:04:44.320 495-3549/? E/ResolverController: No valid NAT64 prefix (121, <unspecified>/0)
2021-07-26 18:04:44.575 495-3563/? E/ResolverController: No valid NAT64 prefix (121, <unspecified>/0)
2021-07-26 18:04:44.576 495-3565/? E/ResolverController: No valid NAT64 prefix (121, <unspecified>/0)
2021-07-26 18:04:44.578 495-3564/? E/ResolverController: No valid NAT64 prefix (121, <unspecified>/0)
2021-07-26 18:04:46.619 1288-1438/? E/WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
2021-07-26 18:04:49.631 1288-1438/? E/WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
2021-07-26 18:04:50.224 1288-1303/? E/GnssVisibilityControl: Proxy app com.mediatek.gnss.nonframeworklbs is not found. AppOps service not notified for notification: {proxyAppPackageName: com.mediatek.gnss.nonframeworklbs, protocolStack: 0, otherProtocolStackName: , requestor: 3, requestorId: Mediatek Modem, responseType: ACCEPTED_NO_LOCATION_PROVIDED, inEmergencyMode: false, isCachedLocation: false}
物流活动
公共类loginactivity扩展了appcompatactivity{
Button getOtpButton;
EditText numberEntered;
ProgressBar processingBar;
FirebaseAuth fAuth;
FirebaseFirestore fStore;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
getOtpButton = findViewById(R.id.nextButton);
processingBar = findViewById(R.id.progressBar);
numberEntered = findViewById(R.id.enterNumber);
fAuth = FirebaseAuth.getInstance();
fStore = FirebaseFirestore.getInstance();
if (fAuth.getCurrentUser() != null){
startActivity(new Intent(this, HomeActivity.class));
finish();
}
getOtpButton.setOnClickListener(v -> {
if (numberEntered.getText().toString().trim().isEmpty()) {
numberEntered.setError("Please enter your Mobile Number");
return;
} else if (numberEntered.getText().toString().length() != 10) {
numberEntered.setError("Please enter a valid Mobile Number");
return;
}
else {
String phoneNumber = "+91" + numberEntered.getText().toString();
requestOTP(phoneNumber);
Intent intent = new Intent(getApplicationContext(),SignupActivity.class).putExtra("phoneNumber", phoneNumber);
LocalBroadcastManager.getInstance(LoginActivity.this).sendBroadcast(intent);
}
processingBar.setVisibility(View.VISIBLE);
getOtpButton.setVisibility(View.INVISIBLE);
});
}
private void requestOTP(String phoneNumber) {
PhoneAuthOptions options =
PhoneAuthOptions.newBuilder(fAuth)
.setPhoneNumber(phoneNumber) // Phone number to verify
.setTimeout(60L, TimeUnit.SECONDS) // Timeout and unit
.setActivity(this) // Activity (for callback binding)
.setCallbacks(mCallbacks) // OnVerificationStateChangedCallbacks
.build();
PhoneAuthProvider.verifyPhoneNumber(options);
}
private final PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onCodeSent(@NonNull @NotNull String s, @NonNull @NotNull PhoneAuthProvider.ForceResendingToken forceResendingToken) {
super.onCodeSent(s, forceResendingToken);
Intent intent = new Intent(getApplicationContext(), GetOtpActivity.class);
intent.putExtra("mobile", numberEntered.getText().toString());
intent.putExtra("verificationId", s);
startActivity(intent);
}
@Override
public void onVerificationCompleted(@NonNull @NotNull PhoneAuthCredential phoneAuthCredential) {
Toast.makeText(LoginActivity.this, "onVerificationCompleted:" + phoneAuthCredential, Toast.LENGTH_SHORT).show();
}
@Override
public void onVerificationFailed(@NonNull @NotNull FirebaseException e) {
Toast.makeText(LoginActivity.this, "OTP sending failed : " + e.getMessage(), Toast.LENGTH_SHORT).show();
processingBar.setVisibility(View.INVISIBLE);
getOtpButton.setVisibility(View.VISIBLE);
}
@Override
public void onCodeAutoRetrievalTimeOut(@NonNull @NotNull String s) {
super.onCodeAutoRetrievalTimeOut(s);
}
};
}
getotpactivity
public class GetOtpActivity extends AppCompatActivity {
Button verifyButton;
TextView resendOtp, otpSentTo;
ProgressBar verifyProgressBar;
EditText enterCode1, enterCode2, enterCode3, enterCode4, enterCode5, enterCode6;
FirebaseAuth fAuth;
FirebaseFirestore fStore;
private String verificationId;
int i = 101;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_get_otp);
//getSupportActionBar().hide();
enterCode1 = findViewById(R.id.enterCode1);
enterCode2 = findViewById(R.id.enterCode2);
enterCode3 = findViewById(R.id.enterCode3);
enterCode4 = findViewById(R.id.enterCode4);
enterCode5 = findViewById(R.id.enterCode5);
enterCode6 = findViewById(R.id.enterCode6);
resendOtp = findViewById(R.id.resendOtp);
otpSentTo = findViewById(R.id.otpSentTo);
verifyProgressBar = findViewById(R.id.verifyProgressBar);
verifyButton = findViewById(R.id.verifyButton);
fAuth = FirebaseAuth.getInstance();
fStore = FirebaseFirestore.getInstance();
otpSentTo.setText(new StringBuilder().append("OTP sent to ").append(String.format(
"+91 %s", getIntent().getStringExtra("mobile")
)).toString());
enterCode1.requestFocus();
verificationId = getIntent().getStringExtra("verificationId");
CountDownTimer timer = new CountDownTimer(100000, 1000) {
@SuppressLint("SetTextI18n")
@Override
public void onTick(long millisUntilFinished) {
i--;
resendOtp.setText(i + "s");
resendOtp.setEnabled(false);
if (i<10){
resendOtp.setText("0" + i + "s");
}
}
@SuppressLint("SetTextI18n")
@Override
public void onFinish() {
resendOtp.setText("RESEND");
resendOtp.setEnabled(true);
}
}.start();
resendOtp.setOnClickListener(v -> {
String phoneNumber = "+91" + getIntent().getStringExtra("mobile");
Toast.makeText(GetOtpActivity.this, "Sending OTP", Toast.LENGTH_SHORT).show();
requestOTP(phoneNumber);
});
verifyButton.setOnClickListener(v -> {
if (enterCode1.getText().toString().isEmpty() ||
enterCode2.getText().toString().isEmpty() ||
enterCode3.getText().toString().isEmpty() ||
enterCode4.getText().toString().isEmpty() ||
enterCode5.getText().toString().isEmpty() ||
enterCode6.getText().toString().isEmpty()){
Toast.makeText(GetOtpActivity.this, "Please enter a valid OTP", Toast.LENGTH_SHORT).show();
return;
}
String code = enterCode1.getText().toString() +
enterCode2.getText().toString() +
enterCode3.getText().toString() +
enterCode4.getText().toString() +
enterCode5.getText().toString() +
enterCode6.getText().toString();
if (verificationId != null){
verifyProgressBar.setVisibility(View.VISIBLE);
verifyButton.setVisibility(View.INVISIBLE);
PhoneAuthCredential phoneAuthCredential = PhoneAuthProvider.getCredential(verificationId, code);
fAuth.signInWithCredential(phoneAuthCredential).addOnCompleteListener(task -> {
// verifyProgressBar.setVisibility(View.GONE);
// verifyButton.setVisibility(View.VISIBLE);
if (task.isSuccessful()){
checkUserProfile();
}
else {
Toast.makeText(GetOtpActivity.this, "Invalid OTP", Toast.LENGTH_SHORT).show();
}
});
}
});
setupOTPInputs();
}
private void setupOTPInputs(){
enterCode1.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!s.toString().trim().isEmpty()){
enterCode2.requestFocus();
}
}
@Override
public void afterTextChanged(Editable s) {}
});
enterCode2.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!s.toString().trim().isEmpty()){
enterCode3.requestFocus();
}
}
@Override
public void afterTextChanged(Editable s) {}
});
enterCode3.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!s.toString().trim().isEmpty()){
enterCode4.requestFocus();
}
}
@Override
public void afterTextChanged(Editable s) {}
});
enterCode4.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!s.toString().trim().isEmpty()){
enterCode5.requestFocus();
}
}
@Override
public void afterTextChanged(Editable s) {}
});
enterCode5.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!s.toString().trim().isEmpty()){
enterCode6.requestFocus();
}
}
@Override
public void afterTextChanged(Editable s) {}
});
enterCode6.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!s.toString().trim().isEmpty()){
verifyButton.performClick();
verifyProgressBar.setVisibility(View.VISIBLE);
verifyButton.setVisibility(View.INVISIBLE);
}
}
@Override
public void afterTextChanged(Editable s) {}
});
//Key listener
enterCode6.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_DEL && enterCode6.getText().toString().isEmpty()){
enterCode5.requestFocus();
}
return false;
});
enterCode5.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_DEL && enterCode5.getText().toString().isEmpty()){
enterCode4.requestFocus();
}
else if (keyCode != KeyEvent.KEYCODE_DEL && !enterCode5.getText().toString().isEmpty()){
enterCode6.requestFocus();
}
return false;
});
enterCode4.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_DEL && enterCode4.getText().toString().isEmpty()){
enterCode3.requestFocus();
}
else if (keyCode != KeyEvent.KEYCODE_DEL && !enterCode4.getText().toString().isEmpty()){
enterCode5.requestFocus();
}
return false;
});
enterCode3.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_DEL && enterCode3.getText().toString().isEmpty()){
enterCode2.requestFocus();
}
else if (keyCode != KeyEvent.KEYCODE_DEL && !enterCode3.getText().toString().isEmpty()){
enterCode4.requestFocus();
}
return false;
});
enterCode2.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_DEL && enterCode2.getText().toString().isEmpty()){
enterCode1.requestFocus();
}
else if (keyCode != KeyEvent.KEYCODE_DEL && !enterCode2.getText().toString().isEmpty()) {
enterCode3.requestFocus();
}
return false;
});
enterCode1.setOnKeyListener((v, keyCode, event) -> {
if (keyCode != KeyEvent.KEYCODE_DEL && !enterCode1.getText().toString().isEmpty()){
enterCode2.requestFocus();
}
return false;
});
}
private void requestOTP(String phoneNumber) {
PhoneAuthOptions options =
PhoneAuthOptions.newBuilder(fAuth)
.setPhoneNumber(phoneNumber) // Phone number to verify
.setTimeout(60L, TimeUnit.SECONDS) // Timeout and unit
.setActivity(this) // Activity (for callback binding)
.setCallbacks(mCallbacks) // OnVerificationStateChangedCallbacks
.build();
PhoneAuthProvider.verifyPhoneNumber(options);
}
private final PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onCodeSent(@NonNull @NotNull String newVerificationId, @NonNull @NotNull PhoneAuthProvider.ForceResendingToken forceResendingToken) {
super.onCodeSent(newVerificationId, forceResendingToken);
verificationId = newVerificationId;
Toast.makeText(GetOtpActivity.this, "OTP sent", Toast.LENGTH_SHORT).show();
// token = forceResendingToken;
// processingBar.setVisibility(View.GONE);
// verificationProgress = true;
}
@Override
public void onVerificationCompleted(@NonNull @NotNull PhoneAuthCredential phoneAuthCredential) {
Toast.makeText(GetOtpActivity.this, "onVerificationCompleted:" + phoneAuthCredential, Toast.LENGTH_SHORT).show();
}
@Override
public void onVerificationFailed(@NonNull @NotNull FirebaseException e) {
Toast.makeText(GetOtpActivity.this, "Cannot create account : " + e.getMessage(), Toast.LENGTH_SHORT).show();
}
@Override
public void onCodeAutoRetrievalTimeOut(@NonNull @NotNull String s) {
super.onCodeAutoRetrievalTimeOut(s);
}
};
// @Override
// protected void onStart() {
// super.onStart();
//
// if (fAuth.getCurrentUser() != null){
// verifyProgressBar.setVisibility(View.VISIBLE);
// Toast.makeText(this, "Processing...", Toast.LENGTH_SHORT).show();
// checkUserProfile();
// }
// }
public void checkUserProfile(){
DocumentReference docRef = fStore.collection("users").document(Objects.requireNonNull(Objects.requireNonNull(fAuth.getCurrentUser()).getPhoneNumber()));
Toast.makeText(GetOtpActivity.this, "Authentication successful", Toast.LENGTH_SHORT).show();
docRef.get().addOnSuccessListener(documentSnapshot -> {
if (documentSnapshot.exists()){
startActivity(new Intent(getApplicationContext(), HomeActivity.class));
finish();
Toast.makeText(GetOtpActivity.this, "Welcome Back", Toast.LENGTH_SHORT).show();
}
else {
startActivity(new Intent(getApplicationContext(), SignupActivity.class));
finish();
}
});
}
}
家庭活动
公共类homeactivity扩展了appcompatactivity{
BottomNavigationView navBottom;
FloatingActionButton notFav;
DrawerLayout drawer;
ActionBarDrawerToggle toggle;
Toolbar toolbar;
ActivityHomeBinding binding;
@SuppressLint("NonConstantResourceId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityHomeBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
notFav = findViewById(R.id.notificationFab);
navBottom = findViewById(R.id.navBottom);
drawer = binding.home;
toolbar = binding.containMain.toolbar;
NavigationView navigationView = findViewById(R.id.nav);
setSupportActionBar(toolbar);
FragmentTransaction homeTrans = getSupportFragmentManager().beginTransaction();
homeTrans.replace(R.id.content, new HomeFragment());
homeTrans.commit();
toggle = new ActionBarDrawerToggle(this,drawer,toolbar,R.string.open,R.string.close);
drawer.addDrawerListener(toggle);
toggle.syncState();
//drawer.closeDrawer(GravityCompat.START);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
drawer.openDrawer(GravityCompat.START);
}
});
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull @NotNull MenuItem item) {
switch (item.getItemId()){
case R.id.homeMenu:
FragmentTransaction homeTrans = getSupportFragmentManager().beginTransaction();
homeTrans.replace(R.id.content, new HomeFragment());
homeTrans.commit();
drawer.closeDrawer(GravityCompat.START);
break;
case R.id.walletsMenu:
startActivity(new Intent(getApplicationContext(), WalletActivity.class));
drawer.closeDrawer(GravityCompat.START);
break;
case R.id.referNEarnMenu:
startActivity(new Intent(getApplicationContext(), ReferNEarn.class));
drawer.closeDrawer(GravityCompat.START);
break;
case R.id.myStatisticsMenu:
Toast.makeText(HomeActivity.this, "stats", Toast.LENGTH_SHORT).show();
drawer.closeDrawer(GravityCompat.START);
break;
case R.id.helpMenu:
startActivity(new Intent(getApplicationContext(), ContactUsActivity.class));
drawer.closeDrawer(GravityCompat.START);
break;
case R.id.logoutMenu:
FirebaseAuth.getInstance().signOut();
finish();
}
return true;
}
});
navBottom.setOnItemSelectedListener(item -> {
switch (item.getItemId()){
case R.id.navHome:
FragmentTransaction homeTrans1 = getSupportFragmentManager().beginTransaction();
homeTrans1.replace(R.id.content, new HomeFragment());
homeTrans1.commit();
break;
case R.id.navMyTournaments:
FragmentTransaction tournamentTrans = getSupportFragmentManager().beginTransaction();
tournamentTrans.replace(R.id.content, new MyTournamentFragment());
tournamentTrans.commit();
break;
case R.id.navMyProfile:
FragmentTransaction profileTrans = getSupportFragmentManager().beginTransaction();
profileTrans.replace(R.id.content, new MyProfileFragment());
profileTrans.commit();
break;
}
return true;
});
notFav.setOnClickListener(v -> startActivity(new Intent(getApplicationContext(), NotificationActivity.class)));
}
@Override
public void onBackPressed() {
if (drawer.isDrawerOpen(GravityCompat.START)){
drawer.closeDrawer(GravityCompat.START);
}
else {
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.home_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == R.id.navCashWallet){
startActivity(new Intent(getApplicationContext(), WalletActivity.class));
}
return super.onOptionsItemSelected(item);
}
}
暂无答案!
目前还没有任何答案,快来回答吧!