如何修复E / AndroidRuntime:致命例外:main,java.lang.RuntimeException:无法启动活动ComponentInfo

时间:2019-05-07 01:11:16

标签: android firebase

我已将Firebase连接到我的应用程序。更新后,我无法在手机上打开该应用程序。它马上出来。我收到以下错误:

import tensorflow as tf
from tf.contrib import rnn
lstm_f = rnn.BasicLSTMCell(n_hidden, forget_bias=1.0)
lstm_b = rnn.BasicLSTMCell(n_hidden, forget_bias=1.0)
blstm_out, state_f, state_b = rnn.static_bidirectional_rnn(lstm_f, lstm_b, x, dtype=tf.float32)

MainActivity.java

2019-05-07 06:15:09.201 16075-16075/com.example.user.smartpoll E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.user.smartpoll, PID: 16075
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.smartpoll/com.example.user.smartpoll.MainActivity}: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.example.user.smartpoll. Make sure to call FirebaseApp.initializeApp(Context) first.
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2814)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:173)
        at android.app.ActivityThread.main(ActivityThread.java:6634)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:822)
     Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.example.user.smartpoll. Make sure to call FirebaseApp.initializeApp(Context) first.
        at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@16.0.1:219)
        at com.google.firebase.auth.FirebaseAuth.getInstance(Unknown Source:1)
        at com.example.user.smartpoll.MainActivity.onCreate(MainActivity.java:46)
        at android.app.Activity.performCreate(Activity.java:7074)
        at android.app.Activity.performCreate(Activity.java:7065)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2767)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:173) 
        at android.app.ActivityThread.main(ActivityThread.java:6634) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 

0 个答案:

没有答案