私は、市場で約70%のデバイスでこのクラッシュを受けています。しかし、それは決してテスト中に出てこなかった。匿名ログイン中にAndroidでFirebaseがクラッシュする
public class MyApp extends Application{
public void onCreate() {
super.onCreate();
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
FirebaseAuth.getInstance().signInAnonymously();
}
}
これはエラーです。
Fatal Exception: java.lang.RuntimeException: Unable to create application com.mycompany.myapp.activities.MyApp: java.lang.ClassCastException: com.google.android.gms.internal.hc cannot be cast to com.google.firebase.auth.c
com.google.android.gms.internal.hc cannot be cast to com.google.firebase.auth.c
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4927)
at android.app.ActivityThread.access$1500(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5633)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: com.google.android.gms.internal.hc cannot be cast to com.google.firebase.auth.c
at com.google.android.gms.internal.aa.a(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.a(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.d(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
at com.google.android.gms.internal.z.<init>(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.c(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.b(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.b(Unknown Source)
at com.tesseractmobile.solitairesdk.activities.SolitaireApp.onCreate(SolitaireApp.java:123)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1020)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4924)
私は今、私はちょうど私たちのアプリでfirebaseを無効にしていますfirebase 9.2.1
compile "com.google.firebase:firebase-core:${firebaseVersion}"
compile "com.google.firebase:firebase-database:${firebaseVersion}"
//For dynamic links
compile "com.google.firebase:firebase-invites:${firebaseVersion}"
//Authentication - for logging winning games
compile "com.google.firebase:firebase-auth:${firebaseVersion}"
を使用しています。私たちはそれがいかに安定しているかを見るためにそれをテストしていました。私はそれがなぜ私たちのテスト装置のすべてで働いたのかを知りませんでした。
更新: Firebase Test Labを使用して問題のビデオを取得することができました。それはロボットが広告(広告がサポートされているアプリ)をクリックしてアプリに戻ったときに発生しました。 FirebaseAuth.getInstance()と何か関係があります。signInAnonymously();二度呼ばれる?しかし、Application.onCreate()は一度だけ呼び出されるべきです。 Firebaseのクラッシュレポートには、2つのアプリケーションインスタンスが作成される既知のバグがありますが、私たちはそのsdkユーティリティを使用して問題を解決していません。
*クラッシュのための膨大な数のデバイス*が約70%です。おそらく、オンラインテストファームを使ってfirebaseクラッシュをテストすることができます。 –
@itnotmenow私はこれを見つける新しいテスト方法を探しています。小さなデバイスファームでユニットテストと接続テストを行います。私たちはテストするデバイスが十数個しかありません。中小企業としては、すでに行っていることよりも多くのことを行うことは財政難です。だから、いくつかの問題は顧客が見つけなければならないものです。 – theJosh
@theJoshあなたのアプリケーションディレクトリに 'google-services.json'をダウンロードし、Firebaseコンソールでパッケージ名とSHA1署名の両方を承認しましたか? –