1

I am writing an application for Android. I am too beginner. I copied and pasted a sample to my project. I want to make Authentication. But It gives me an exception of connection. I have created a firebase. I connect to my firebase server. But There is still one exception. I click to my button and result always return me. Same exception result. Here is my code, layout and images : enter image description here enter image description here My layout:

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="textEmailAddress"
    android:layout_marginTop="10dp"

    android:id="@+id/uyeEmail" />

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="textPassword"
    android:ems="10"
    android:layout_marginTop="10dp"
    android:id="@+id/uyeParola"
    />


<Button
    android:text="Üye Ol!"
    android:layout_width="100dp"
    android:layout_height="50dp"
    android:layout_marginTop="50dp"

    android:id="@+id/yeniUyeButton"
  />


<Button
    android:text="Zaten üye misin?"
    android:layout_width="200dp"
    android:layout_height="wrap_content"

    android:id="@+id/uyeGirisButton"

    android:layout_marginBottom="10dp"
    />

My codes :

  auth = FirebaseAuth.getInstance();
        uyeParola = (EditText)findViewById(R.id.uyeParola);
        uyeEmail = (EditText)findViewById(R.id.uyeEmail);

        uyeGirisButton = (Button)findViewById(R.id.uyeGirisButton);
        uyeGirisButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });



        yeniUyeButton = (Button)findViewById(R.id.yeniUyeButton);
        yeniUyeButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String email = uyeEmail.getText().toString();
                String parola = uyeParola.getText().toString();

                if(TextUtils.isEmpty(email)){
                    Toast.makeText(getApplicationContext(),"Lütfen emailinizi giriniz",Toast.LENGTH_SHORT).show();
                    return;
                }
                if(TextUtils.isEmpty(parola)){
                    Toast.makeText(getApplicationContext(),"Lütfen parolanızı giriniz",Toast.LENGTH_SHORT).show();
                }
                if (parola.length()<6){
                    Toast.makeText(getApplicationContext(),"Parola en az 6 haneli olmalıdır",Toast.LENGTH_SHORT).show();
                }

                //FirebaseAuth ile email,parola parametrelerini kullanarak yeni bir kullanıcı oluşturuyoruz.
                auth.createUserWithEmailAndPassword(email,parola)
                        .addOnCompleteListener(giris.this, new OnCompleteListener<AuthResult>() {
                            @Override
                            public void onComplete(@NonNull Task<AuthResult> task) {

                                //İşlem başarısız olursa kullanıcıya bir Toast mesajıyla bildiriyoruz.
                                if (!task.isSuccessful()) {
                                    Toast.makeText(giris.this, "Exception... Sorry :(",
                                            Toast.LENGTH_SHORT).show();
                                }

                                //İşlem başarılı olduğu takdir de giriş yapılıp MainActivity e yönlendiriyoruz.
                                else {
                                    startActivity(new Intent(giris.this, MainActivity.class));
                                    finish();
                                }

                            }
                        });
            }
        });

My permission :

<uses-permission android:name="android.permission.INTERNET"></uses-permission>[enter image description here][1]
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
  • Please copy paste exception details. – Dexter May 30 '18 at 10:03
  • Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.0. – Berkay Isıkoglu May 30 '18 at 10:34
  • Please give me a answer . Why I am seeing this error . And how can I fix it ? I used to 2 proporties only. – Berkay Isıkoglu May 30 '18 at 11:03
  • Please share your `build.gradle` file. – Alex Mamo May 30 '18 at 11:51

1 Answers1

0

Throughout 3 days , I have searched my question. And I found finally the answer. I have to pasted this peace of code to my build.grandle . If I don"t , I always encounter like these problems.

Here is link which I copied :

Still getting warning : Configuration 'compile' is obsolete and has been replaced with 'implementation'

Peace of code :

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        classpath 'com.google.gms:google-services:3.2.0'
    }
}