火力地堡验证“谷歌Play商店缺失”的问题
我曾尝试我的应用程序连接火力点,但我不能 使用的是Android 2.2.3工作室火力地堡验证“谷歌Play商店缺失”的问题
我在 的gradle构建添加依赖(项目)
AM// 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
}
,并建立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'
和我的代码是
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();
}
}
}
有 两个文本字段(EditTexts)和 一键 我接到了一个视频教程 这个代码,他们成功地执行这一点,但我已经试过有显示异常的XML布局
03 -14 13:31:31.585 1054年至1772年/ system_process V /窗口管理:添加 窗口窗口{f249820 U0 PopupWindow:5e4fee9}在8 3(后 窗口{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未实现03-14 13:31:31.642 2331-2632/dev.fbase.com.firebaseexample W/OpenGLRenderer:未能到 在表面上设置EGL_SWAP_BEHAVIOR 0xe242b580 ,error = EGL_SUCCESS 03-14 13:32:00.808 1054-1225/system_process W/AudioTrack: 客户端拒绝AUDIO_OUTPUT_FLAG_FAST 03-14 13:32:00.846 1054-1502/system_process V/WindowManager:not Base app:Adding窗口 窗口{4bd695 u0 dev.fbase.com.firebaseexample/dev.fbase.com.firebaseexample.MainActivity} at 3 of 8 03-14 13:32:00.852 2331-2619/dev.fbase.com.firebaseexample W/DynamiteModule:本地模块描述符类,用于 com.google.fi未找到rebase.auth。 03-14 13:32:00.852 2331-2619/dev.fbase.com.firebaseexample W/GooglePlayServicesUtil: Google Play商店缺失。 03-14 13:32:00.911 2331-2632/dev.fbase.com.firebaseexample W/EGL_emulation: eglSurfaceAttrib not implemented 03-14 13:32:00.912 2331-2632/dev.fbase.com.firebaseexample W/OpenGLRenderer:无法在表面0xe242b720上设置EGL_SWAP_BEHAVIOR,错误= EGL_SUCCESS 03-14 13:32:01.335 2331-2632/dev.fbase.com.firebaseexample W/EGL_emulation: eglSurfaceAttrib未实施03-14 13:32:01.335 2331-2632/dev.fbase.com.firebaseexample W/OpenGLRenderer:无法在表面0xe247da20上设置EGL_SWAP_BEHAVIOR,错误= EGL_SUCCESS 03-14 13:32:01.721 2331-2632/dev.fbase.com.firebaseexample V/RenderScript: 0xeed9da00启动线程,CPU 4
stacktrace表示设备中缺少Google Play商店。要使Firebase正常工作,您需要安装Google Play Services 10或更高版本的设备。 (从https://firebase.google.com/docs/android/setup)。如果它是一个模拟器,请确保您创建了包含Google API的模拟器。