Я работаю над созданием приложения для Android с использованием FireBase, но приложение работает без FireBase, хуже всего то, что Android Studio не показывает ошибку, но приложение падает после добавления Firebase Authentication.в чем будет проблема?Любая помощь приветствуется.
Я попытался изменить версию Firebase, попытался изменить файл Gradle и создал различные проекты в FireBase, чтобы увидеть, если это ничего не меняет
package com.example.manual;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.content.Intent;
import android.widget.EditText;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class MainActivity extends AppCompatActivity {
EditText e1,e2;
FirebaseAuth mAuth ;
FirebaseUser currentUser;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//e1 = (EditText) findViewById(R.id.edit)
mAuth = FirebaseAuth.getInstance();
currentUser = mAuth.getCurrentUser();
}
@Override
public void onStart() {
super.onStart();
// Check if user is signed in (non-null) and update UI accordingly.
if(currentUser == null){
Intent startIntent = new
Intent(MainActivity.this,RegisterActivity.class);
startActivity(startIntent);
finish();
}
}
}
Gradele file
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.manual"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-
optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core: 3.0.2 '}
apply plugin: 'com.google.gms.google-services'
Project manual file
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
в окне помощника Firebase, он показывает, что он подключен, но все равно приложение вылетает каждый раз, когда я пытаюсь запустить его на моем реальном устройстве?пожалуйста, помогите, не судите меня, я только начал учить себя.