Soru & Cevap

girisButtonu bu buttona tıkladığımda Unfortunately has stopped hatası alıyorum

13.06.2020 - 09:49

Aldığım hata mesajı bu şekilde

06-13 21:39:42.866 18503-18503/com.example.whatsapp E/dalvikvm: Could not find class 'androidx.core.view.ViewCompat$2', referenced from method androidx.core.view.ViewCompat.addOnUnhandledKeyEventListener
06-13 21:39:42.866 18503-18503/com.example.whatsapp E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method androidx.core.view.ViewCompat.dispatchApplyWindowInsets
06-13 21:39:42.886 18503-18503/com.example.whatsapp E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method androidx.core.view.ViewCompat.onApplyWindowInsets
06-13 21:39:42.886 18503-18503/com.example.whatsapp E/dalvikvm: Could not find class 'android.view.View$OnUnhandledKeyEventListener', referenced from method androidx.core.view.ViewCompat.removeOnUnhandledKeyEventListener
06-13 21:39:42.906 18503-18503/com.example.whatsapp E/dalvikvm: Could not find class 'androidx.core.view.ViewCompat$1', referenced from method androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener
06-13 21:39:43.056 18503-18503/com.example.whatsapp E/dalvikvm: Could not find class 'android.view.textclassifier.TextClassificationManager', referenced from method androidx.appcompat.widget.AppCompatTextClassifierHelper.getTextClassifier
06-13 21:39:43.066 18503-18503/com.example.whatsapp E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method androidx.appcompat.widget.AppCompatImageHelper.hasOverlappingRendering
06-13 21:39:43.076 18503-18503/com.example.whatsapp E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method com.google.android.material.tabs.TabLayout$TabView.updateBackgroundDrawable
06-13 21:41:20.816 18503-18503/com.example.whatsapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.whatsapp, PID: 18503
    java.lang.NullPointerException
        at com.example.whatsapp.LoginActivity.KullaniciyaGirisİzniVer(LoginActivity.java:72)
        at com.example.whatsapp.LoginActivity.access$000(LoginActivity.java:22)
        at com.example.whatsapp.LoginActivity$2.onClick(LoginActivity.java:65)
        at android.view.View.performClick(View.java:4440)
        at android.view.View$PerformClick.run(View.java:18444)
        at android.os.Handler.handleCallback(Handler.java:733)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5050)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
        at dalvik.system.NativeStart.main(Native Method)

 

===============================================================================================

kod bölümü


package com.example.whatsapp; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; public class LoginActivity extends AppCompatActivity { private FirebaseUser mevcutKullanici; private FirebaseAuth mYetki; private ProgressDialog girisDialog; private Button girisButtonu,telefonlaGirisButonu; private EditText kullaniciMail,kullaniciSifre; private TextView yeniHesapAlma,sifreUnutmaBaglanti; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); //kontrol tanımlamaları girisButtonu = findViewById(R.id.giris_butonu); telefonlaGirisButonu = findViewById(R.id.giris_butonu); kullaniciMail = findViewById(R.id.kayit_email); kullaniciSifre = findViewById(R.id.giris_sifre); yeniHesapAlma = findViewById(R.id.yeni_hesap_alma); sifreUnutmaBaglanti = findViewById(R.id.sifre_unutma_baglantisi); mYetki = FirebaseAuth.getInstance(); mevcutKullanici = mYetki.getCurrentUser(); girisDialog = new ProgressDialog(this); yeniHesapAlma.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent kayitActivityIntent = new Intent(LoginActivity.this,KayitActivity.class); startActivity(kayitActivityIntent); } }); girisButtonu.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { KullaniciyaGirisİzniVer(); } }); } private void KullaniciyaGirisİzniVer() { String email = kullaniciMail.getText().toString(); String sifre = kullaniciSifre.getText().toString(); if (TextUtils.isEmpty(email)) { Toast.makeText(this, "Email boş olamaz!", Toast.LENGTH_SHORT).show(); } if (TextUtils.isEmpty(sifre)) { Toast.makeText(this, "Şifre boş olamaz!", Toast.LENGTH_SHORT).show(); } else { //Progress girisDialog.setTitle("Giriş yapılıyor"); girisDialog.setMessage("Lütfen bekleyin..."); girisDialog.setCanceledOnTouchOutside(true); girisDialog.show(); mYetki.signInWithEmailAndPassword(email,sifre).addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()){ Intent anaSayfaIntent = new Intent(LoginActivity.this,MainActivity.class); startActivity(anaSayfaIntent); Toast.makeText(LoginActivity.this, "Giriş Başarılı", Toast.LENGTH_SHORT).show(); girisDialog.dismiss(); } else { String mesaj = task.getException().toString(); Toast.makeText(LoginActivity.this, "Hata :"+mesaj+"bilgileri kontrol ediniz", Toast.LENGTH_SHORT).show(); girisDialog.dismiss(); } } }); } } @Override protected void onStart() { super.onStart(); if (mevcutKullanici != null){ kullaniciyiAnaAktivityeGonder(); } } private void kullaniciyiAnaAktivityeGonder() { Intent anaAktiviteIntent = new Intent(LoginActivity.this,MainActivity.class); startActivity(anaAktiviteIntent); } }
 

 

 

8 Görüntülenme

1 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

picture-112887-1506457490.jpg
recepözen
16.06.2020 - 06:37

bir view elemanın tanımını yanlış yaptığını var sayıyorum. NullPointerException hatası alıyorsun LoginActivity.java:65 satıra dikkatli bakmalısın