mauth.signInWithEmailAndPassword вылетает из моего приложения для Android - PullRequest
0 голосов
/ 27 сентября 2018

Я пытаюсь аутентифицировать пользователя, используя аутентификацию firebase, но пока функция mAuth.signInWithEmailAndPassword () завершает работу приложения.Идентификатор электронной почты и пароль сохраняются в Firebase, который я проверил.Kotlin - это используемый язык.Код LoginActivity.kt приведен ниже:

private lateinit var mAuth:FirebaseAuth
private lateinit var mAuthListener:FirebaseAuth.AuthStateListener


class LoginActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_login)
    val goto=Intent(this,book_slot::class.java)

    val admin=loginName.toString()
    val admin_pass=loginPassword.toString()
    registerButton.setOnClickListener{
        startActivity(Intent(this,register_page::class.java))
    }

    signInButton.setOnClickListener {
        mAuth.signInWithEmailAndPassword(admin,admin_pass).addOnCompleteListener(this) { task ->
            if(task.isSuccessful) {
                val user= mAuth.currentUser
                Toast.makeText(this,"$user",Toast.LENGTH_LONG).show()
                startActivity(goto)
            } else {
                Toast.makeText(this,"Login error",Toast.LENGTH_LONG).show()
            }
        }
    }
}

Трассировка стека:

2018-09-27 13:26:27.414 1368-1368/? I/zygote64: Late-enabling -Xcheck:jni2018-09-27 13:26:27.445 1368-1368/? I/zygote64: Reinit property: dalvik.vm.checkjni= false2018-09-27 13:26:27.469 1368-1368/? D/ActivityThread: ActivityThread,attachApplication2018-09-27 13:26:27.476 1368-1375/? I/zygote64: Debugger is no longer active2018-09-27 13:26:27.528 1368-1368/? D/HwFLClassLoader: get used feature list :/feature/used-list failed!2018-09-27 13:26:27.528 1368-1368/? D/HwFLClassLoader: USE_FEATURE_LIST had not init!2018-09-27 13:26:27.959 1368-1398/? W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.2018-09-27 13:26:27.995 1368-1368/? D/FirebaseAuth: Notifying id token listeners about user ( Zi54TkQUuOeiAuAF9H9yTkLbt0l2 ).2018-09-27 13:26:28.004 1368-1400/? W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.2018-09-27 13:26:28.019 1368-1400/? I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.2018-09-27 13:26:28.019 1368-1400/? I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation2018-09-27 13:26:28.059 1368-1368/? V/FA: Registered activity lifecycle callback2018-09-27 13:26:28.063 1368-1368/? D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.2018-09-27 13:26:28.064 1368-1368/? I/FirebaseInitProvider: FirebaseApp initialization successful2018-09-27 13:26:28.067 1368-1368/? I/InstantRun: starting instant run server: is main process2018-09-27 13:26:28.072 1368-1368/? E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist!2018-09-27 13:26:28.074 1368-1368/? E/Minikin: Could not get cmap table size!2018-09-27 13:26:28.116 1368-1368/? I/HwCust: Constructor found for class android.app.HwCustActivityImpl2018-09-27 13:26:28.116 1368-1368/? D/HwCust: Create obj success use class android.app.HwCustActivityImpl2018-09-27 13:26:28.121 1368-1404/? V/FA: Collection enabled2018-09-27 13:26:28.122 1368-1404/? V/FA: App package, google app id: com.example.som.smartparkingsystem, 1:410341218016:android:36f64bc573c360002018-09-27 13:26:28.123 1368-1404/? I/FA: App measurement is starting up, version: 130012018-09-27 13:26:28.123 1368-1404/? I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE2018-09-27 13:26:28.123 1368-1404/? I/FA: To enable faster debug mode event logging run:      adb shell setprop debug.firebase.analytics.app com.example.som.smartparkingsystem2018-09-27 13:26:28.123 1368-1404/? D/FA: Debug-level message logging enabled2018-09-27 13:26:28.139 1368-1368/? V/HwPolicyFactory: : success to get AllImpl object and return....2018-09-27 13:26:28.144 1368-1368/? I/HwCust: Constructor found for class android.app.HwCustHwWallpaperManagerImpl2018-09-27 13:26:28.144 1368-1368/? D/HwCust: Create obj success use class android.app.HwCustHwWallpaperManagerImpl2018-09-27 13:26:28.150 1368-1368/? V/HwWidgetFactory: : successes to get AllImpl object and return....2018-09-27 13:26:28.162 1368-1368/? V/ActivityThread: ActivityThread,callActivityOnCreate2018-09-27 13:26:28.193 1368-1404/? V/FA: Connecting to remote service2018-09-27 13:26:28.198 1368-1368/? V/FA: onActivityCreated2018-09-27 13:26:28.217 1368-1404/? V/FA: Connection attempt already in progress2018-09-27 13:26:28.261 1368-1368/? D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0e011b, context : com.example.som.smartparkingsystem.logo_splash@53cfdae, Nhwext : 0, get Blur : disable with , null2018-09-27 13:26:28.262 1368-1368/? D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0e011b, context : com.example.som.smartparkingsystem.logo_splash@53cfdae, Nhwext : 0, get Blur : disable with , null2018-09-27 13:26:28.309 1368-1368/? W/Utils: Utils_isSuperResolutionSupport [load libai_client.so failed]2018-09-27 13:26:28.312 1368-1368/? D/HwGalleryCacheManagerImpl: mIsEffect:false2018-09-27 13:26:28.623 1368-1368/com.example.som.smartparkingsystem D/ActivityThread: add activity client record, r= ActivityRecord{4ea3b99 token=android.os.BinderProxy@a316d62 {com.example.som.smartparkingsystem/com.example.som.smartparkingsystem.logo_splash}} token= android.os.BinderProxy@a316d622018-09-27 13:26:28.634 1368-1404/com.example.som.smartparkingsystem I/FA: Tag Manager is not found and thus will not be used2018-09-27 13:26:28.645 1368-1404/com.example.som.smartparkingsystem D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=logo_splash, firebase_screen_id(_si)=5410141970236651654}]2018-09-27 13:26:28.646 1368-1368/com.example.som.smartparkingsystem D/OpenGLRenderer:   HWUI Binary is  enabled2018-09-27 13:26:28.649 1368-1413/com.example.som.smartparkingsystem D/OpenGLRenderer: HWUI GL Pipeline2018-09-27 13:26:28.661 1368-1368/com.example.som.smartparkingsystem D/FirebaseApp: Notifying auth state listeners.2018-09-27 13:26:28.661 1368-1368/com.example.som.smartparkingsystem D/FirebaseApp: Notified 0 auth state listeners.2018-09-27 13:26:28.671 1368-1368/com.example.som.smartparkingsystem I/PressGestureDetector: enabledInPad = false,isPcCastMode = false2018-09-27 13:26:28.685 1368-1404/com.example.som.smartparkingsystem V/FA: Connection attempt already in progress2018-09-27 13:26:28.685 1368-1404/com.example.som.smartparkingsystem V/FA: Connection attempt already in progress2018-09-27 13:26:28.686 1368-1404/com.example.som.smartparkingsystem V/FA: Activity resumed, time: 1009070862018-09-27 13:26:28.714 1368-1413/com.example.som.smartparkingsystem I/OpenGLRenderer: Initialized EGL, version 1.42018-09-27 13:26:28.714 1368-1413/com.example.som.smartparkingsystem D/OpenGLRenderer: Swap behavior 22018-09-27 13:26:28.719 1368-1368/com.example.som.smartparkingsystem W/InputMethodManager: startInputReason = 12018-09-27 13:26:28.723 1368-1413/com.example.som.smartparkingsystem D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x30002018-09-27 13:26:28.903 1368-1368/com.example.som.smartparkingsystem W/InputMethodManager: startInputReason = 52018-09-27 13:26:28.903 1368-1404/com.example.som.smartparkingsystem D/FA: Connected to remote service2018-09-27 13:26:28.906 1368-1404/com.example.som.smartparkingsystem V/FA: Processing queued up service tasks: 42018-09-27 13:26:31.643 1368-1404/com.example.som.smartparkingsystem V/FA: Recording user engagement, ms: 30152018-09-27 13:26:31.647 1368-1404/com.example.som.smartparkingsystem V/FA: Activity paused, time: 1009101002018-09-27 13:26:31.661 1368-1404/com.example.som.smartparkingsystem D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=3015, firebase_screen_class(_sc)=logo_splash, firebase_screen_id(_si)=5410141970236651654}]2018-09-27 13:26:31.678 1368-1368/com.example.som.smartparkingsystem D/HwCust: Create obj success use class android.app.HwCustActivityImpl2018-09-27 13:26:31.679 1368-1368/com.example.som.smartparkingsystem D/HwCust: Create obj success use class android.app.HwCustHwWallpaperManagerImpl2018-09-27 13:26:31.683 1368-1368/com.example.som.smartparkingsystem V/ActivityThread: ActivityThread,callActivityOnCreate2018-09-27 13:26:31.687 1368-1368/com.example.som.smartparkingsystem V/FA: onActivityCreated2018-09-27 13:26:31.713 1368-1368/com.example.som.smartparkingsystem D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0e011b, context : com.example.som.smartparkingsystem.LoginActivity@da46f27, Nhwext : 0, get Blur : disable with , null2018-09-27 13:26:31.714 1368-1368/com.example.som.smartparkingsystem D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0e011b, context : com.example.som.smartparkingsystem.LoginActivity@da46f27, Nhwext : 0, get Blur : disable with , null2018-09-27 13:26:31.750 1368-1373/com.example.som.smartparkingsystem I/zygote64: Do partial code cache collection, code=27KB, data=20KB2018-09-27 13:26:31.750 1368-1373/com.example.som.smartparkingsystem I/zygote64: After code cache collection, code=27KB, data=20KB2018-09-27 13:26:31.751 1368-1373/com.example.som.smartparkingsystem I/zygote64: Increasing code cache capacity to 128KB2018-09-27 13:26:31.843 1368-1368/com.example.som.smartparkingsystem D/ActivityThread: add activity client record, r= ActivityRecord{b0c2f56 token=android.os.BinderProxy@bd8894b {com.example.som.smartparkingsystem/com.example.som.smartparkingsystem.LoginActivity}} token= android.os.BinderProxy@bd8894b2018-09-27 13:26:31.854 1368-1413/com.example.som.smartparkingsystem D/OpenGLRenderer:   HWUI Binary is  enabled2018-09-27 13:26:31.858 1368-1404/com.example.som.smartparkingsystem D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=logo_splash, firebase_previous_id(_pi)=5410141970236651654, firebase_screen_class(_sc)=LoginActivity, firebase_screen_id(_si)=5410141970236651655}]2018-09-27 13:26:31.863 1368-1413/com.example.som.smartparkingsystem D/OpenGLRenderer:   HWUI Binary is  enabled2018-09-27 13:26:31.873 1368-1368/com.example.som.smartparkingsystem I/PressGestureDetector: enabledInPad = false,isPcCastMode = false2018-09-27 13:26:31.903 1368-1404/com.example.som.smartparkingsystem V/FA: Activity resumed, time: 1009103062018-09-27 13:26:31.954 1368-1413/com.example.som.smartparkingsystem D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x30002018-09-27 13:26:32.009 1368-1368/com.example.som.smartparkingsystem W/InputMethodManager: startInputReason = 12018-09-27 13:26:32.040 1368-1368/com.example.som.smartparkingsystem W/View: dispatchProvideAutofillStructure(): not laid out, ignoring2018-09-27 13:26:32.048 1368-1368/com.example.som.smartparkingsystem I/AssistStructure: Flattened final assist data: 2708 bytes, containing 1 windows, 9 views2018-09-27 13:26:32.055 1368-1413/com.example.som.smartparkingsystem W/libEGL: EGLNativeWindowType 0x7d8c2c4010 disconnect failed2018-09-27 13:26:32.157 1368-1368/com.example.som.smartparkingsystem D/ActivityThread: Remove activity client record, r= ActivityRecord{4ea3b99 token=android.os.BinderProxy@a316d62 {com.example.som.smartparkingsystem/com.example.som.smartparkingsystem.logo_splash}} token= android.os.BinderProxy@a316d622018-09-27 13:26:32.172 1368-1368/com.example.som.smartparkingsystem E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length2018-09-27 13:26:32.995 1368-1368/com.example.som.smartparkingsystem I/hwaps: JNI_OnLoad2018-09-27 13:26:32.999 1368-1368/com.example.som.smartparkingsystem W/Settings: mValues not put! needsGenerationTracker: true currentGeneration: -1 name: enable_navbar value: null2018-09-27 13:26:33.703 1368-1368/com.example.som.smartparkingsystem E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length2018-09-27 13:26:33.716 1368-1368/com.example.som.smartparkingsystem I/chatty: uid=10159(u0_a159) com.example.som.smartparkingsystem identical 2 lines2018-09-27 13:26:33.716 1368-1368/com.example.som.smartparkingsystem E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length2018-09-27 13:26:35.439 1368-1373/com.example.som.smartparkingsystem I/zygote64: Do partial code cache collection, code=61KB, data=50KB2018-09-27 13:26:35.439 1368-1373/com.example.som.smartparkingsystem I/zygote64: After code cache collection, code=61KB, data=50KB2018-09-27 13:26:35.439 1368-1373/com.example.som.smartparkingsystem I/zygote64: Increasing code cache capacity to 256KB2018-09-27 13:26:36.905 1368-1404/com.example.som.smartparkingsystem V/FA: Inactivity, disconnecting from the service2018-09-27 13:26:37.320 1368-1368/com.example.som.smartparkingsystem E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length2018-09-27 13:26:37.320 1368-1368/com.example.som.smartparkingsystem E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length2018-09-27 13:26:37.997 1368-1368/com.example.som.smartparkingsystem W/InputMethodManager: startInputReason = 42018-09-27 13:26:38.891 1368-1404/com.example.som.smartparkingsystem V/FA: Session started, time: 1009173502018-09-27 13:26:38.897 1368-1404/com.example.som.smartparkingsystem D/FA: Setting user property (FE): _sid2018-09-27 13:26:38.955 1368-1404/com.example.som.smartparkingsystem V/FA: Connecting to remote service2018-09-27 13:26:38.970 1368-1404/com.example.som.smartparkingsystem D/FA: Logging event (FE): session_start(_s), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=LoginActivity, firebase_screen_id(_si)=5410141970236651655}]2018-09-27 13:26:39.001 1368-1404/com.example.som.smartparkingsystem V/FA: Connection attempt already in progress2018-09-27 13:26:39.002 1368-1404/com.example.som.smartparkingsystem D/FA: Connected to remote service2018-09-27 13:26:39.004 1368-1404/com.example.som.smartparkingsystem V/FA: Processing queued up service tasks: 22018-09-27 13:26:39.880 1368-1373/com.example.som.smartparkingsystem I/zygote64: Do full code cache collection, code=123KB, data=104KB2018-09-27 13:26:39.881 1368-1373/com.example.som.smartparkingsystem I/zygote64: After code cache collection, code=113KB, data=68KB2018-09-27 13:26:40.709 1368-1368/com.example.som.smartparkingsystem V/AudioManager: playSoundEffect   effectType: 02018-09-27 13:26:40.712 1368-1368/com.example.som.smartparkingsystem D/AndroidRuntime: Shutting down VM2018-09-27 13:26:40.715 1368-1368/com.example.som.smartparkingsystem E/AndroidRuntime: FATAL EXCEPTION: main    Process: com.example.som.smartparkingsystem, PID: 1368    kotlin.UninitializedPropertyAccessException: lateinit property mAuth has not been initialized
    at com.example.som.smartparkingsystem.LoginActivityKt.access$getMAuth$p(LoginActivity.kt:1)
    at com.example.som.smartparkingsystem.LoginActivity$onCreate$2.onClick(LoginActivity.kt:32)
    at android.view.View.performClick(View.java:6291)
    at android.view.View$PerformClick.run(View.java:24931)
    at android.os.Handler.handleCallback(Handler.java:808)
    at android.os.Handler.dispatchMessage(Handler.java:101)
    at android.os.Looper.loop(Looper.java:166)
    at android.app.ActivityThread.main(ActivityThread.java:7425)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
2018-09-27 13:26:40.730 1368-1368/com.example.som.smartparkingsystem I/Process: Sending signal. PID: 1368 SIG: 9
...