2017-03-15 6 views
0

Ich habe versucht, meine app mit Feuerbasis zu verbinden, aber ich kann nicht ist mit Android Studio 2.2.3Firebase Auth "Google Play Store fehlt" Ausgabe

Ich habe hinzugefügt Abhängigkeiten in Build gradle (Projekt)

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.3' 
     classpath 'com.google.gms:google-services:3.0.0' 

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

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

und bauen gradle (app)

apply plugin: 'com.android.application' 
android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "dev.fbase.com.firebaseexample" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.0.1' 
    testCompile 'junit:junit:4.12' 
    compile 'com.google.firebase:firebase-auth:10.0.0' 
} 
apply plugin: 'com.google.gms.google-services' 

und mein Code

public class MainActivity extends AppCompatActivity implements View.OnClickListener{ 
    private EditText editTextEmail,editTextPassword; 
    private Button btnRegister; 
    private ProgressDialog progressDialog; 
    private FirebaseAuth firebaseAuth; 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 
     progressDialog = new ProgressDialog(this); 
     editTextEmail = (EditText)findViewById(R.id.editTextEmail); 
     editTextPassword = (EditText)findViewById(R.id.editTextPassword); 
     btnRegister = (Button) findViewById(R.id.btnRegister); 
     firebaseAuth = FirebaseAuth.getInstance(); 

     btnRegister.setOnClickListener(this); 


    } 
    public void register(){ 
     String email = editTextEmail.getText().toString().trim(); 
     String password = editTextPassword.getText().toString().trim(); 
     Toast.makeText(this, ""+email+password, Toast.LENGTH_SHORT).show(); 

     if (TextUtils.isEmpty(email)||TextUtils.isEmpty(password)) 
     { 
      Toast.makeText(MainActivity.this,"fill all the fields",Toast.LENGTH_SHORT).show(); 
      return; 
     } 
     progressDialog.setMessage("Registering.."); 
     progressDialog.show(); 
     firebaseAuth.createUserWithEmailAndPassword(email,password) 
       .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { 
        @Override 
        public void onComplete(@NonNull Task<AuthResult> task) { 
         Toast.makeText(MainActivity.this, "success", Toast.LENGTH_SHORT).show(); 

         if(task.isSuccessful()) 
         { 
          progressDialog.dismiss(); 

          Toast.makeText(MainActivity.this,"Registration Success",Toast.LENGTH_SHORT).show(); 
         } 
         else 
         { 
          Toast.makeText(MainActivity.this,"Registration Failed",Toast.LENGTH_SHORT).show(); 
         } 
        } 
       }); 
    } 
    @Override 
    public void onClick(View v) { 
     if(v==btnRegister) 
     { 
      register(); 
     } 

    } 
} 

das xml Layout zwei Textfelder (EditTexts) und One Button Ich habe diesen Code aus einem Tutorial Video Sie dies erfolgreich ausgeführt, aber ich habe versucht, es zeigt eine Ausnahme

03 mit -14 13: 31: 31.585 1054-1772/system_process V/WindowManager: Hinzufügen von Fenster Fenster {f249820 u0 PopupWindow: 5e4fee9} bei 3 von 8 (nach Fenster {d1abaee u0 dev.fbase.com.firebaseexample/dev.fbase .com.firebaseexample.MainActivity}) 03-14 13: 31: 31.642 2331 -2632/dev.fbase.com.firebaseexample W/EGL_emulation: eglSurfaceAttrib nicht implementiert 03-14 13: 31: 31.642 2331-2632/dev.fbase.com.firebaseexample W/OpenGLRenderer: Fehler beim set EGL_SWAP_BEHAVIOR auf der Oberfläche 0xe242b580 , Fehler = EGL_SUCCESS 03-14 13: 32: 00.808 1054-1225/system_process Mit AudioTrack: AUDIO_OUTPUT_FLAG_FAST vom Client abgelehnt 03-14 13: 32: 00.846 1054-1502/system_process V/WindowManager: nicht Basis-App: Hinzufügen Fenster Fenster {4bd695 u0 dev.fbase.com.firebaseexample/dev.fbase.com.firebaseexample.MainActivity} bei 3 von 8 03-14 13: 32: 00.852 2331-2619/dev.fbase.com.firebaseexample W/DynamiteModule: Lokale Modul-Deskriptorklasse für com.google.fi rebase.auth nicht gefunden. 03-14 13: 32: 00.852 2331-2619/dev.fbase.com.firebaseexample W/GooglePlayServicesUtil: Google Play Store fehlt. 03-14 13: 32: 00.911 2331-2632/dev.fbase.com.firebaseexample W/EGL_emulation: eglSurfaceAttrib nicht implementiert 03-14 13: 32: 00.912 2331-2632/dev.fbase.com.firebaseexample W/OpenGLRenderer: Fehler beim Satz EGL_SWAP_BEHAVIOR auf Oberfläche 0xe242b720, error = EGL_SUCCESS 03-14 13: 32: 01,335 2331-2632/dev.fbase.com.firebaseexample W/EGL_emulation: eglSurfaceAttrib 03-14 nicht implementiert 13: 32: 01,335 2331-2632/dev.fbase.com.firebaseexample W/OpenGLRenderer: Fehler beim Set EGL_SWAP_BEHAVIOR auf Oberfläche 0xe247da20, Fehler = EGL_SUCCESS 03-14 13: 32: 01.721 2331-2632/dev.fbase.com.firebaseexample V/RenderScript: 0xeed9da00 Starting thread (s), CPUs 4

Antwort

2

Der Stacktrace sagt, dass die Google Play Store in das Gerät fehlt. Damit Firebase funktioniert, benötigen Sie ein Gerät mit Google Play Services 10 oder höher. (Von https://firebase.google.com/docs/android/setup). Wenn es sich um einen Emulator handelt, stellen Sie sicher, dass Sie den Emulator mit den enthaltenen Google APIs erstellen.

Verwandte Themen