这是logcat消息
FATAL EXCEPTION: main
java.lang.IllegalAccessError: tried to access method java.util.concurrent.ScheduledThreadPoolExecutor.setRemoveOnCancelPolicy:()V from class com.firebase.client.utilities.DefaultRunLoop
at com.firebase.client.utilities.DefaultRunLoop.<init>(DefaultRunLoop.java:45)
at com.firebase.client.android.AndroidPlatform$1.<init>(AndroidPlatform.java:44)
at com.firebase.client.android.AndroidPlatform.newRunLoop(AndroidPlatform.java:44)
at com.firebase.client.core.Context.ensureRunLoop(Context.java:224)
at com.firebase.client.core.Context.initServices(Context.java:111)
at com.firebase.client.core.Context.freeze(Context.java:92)
at com.firebase.client.core.RepoManager.getLocalRepo(RepoManager.java:55)
at com.firebase.client.core.RepoManager.getRepo(RepoManager.java:19)
at com.firebase.client.Firebase.<init>(Firebase.java:172)
at com.firebase.client.Firebase.<init>(Firebase.java:177)
at com.firebase.client.Firebase.<init>(Firebase.java:155)
at elnagga.forebasedemo.MainActivity.onCreate(MainActivity.java:24)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:3)
看看Android App is crashing when connecting to Firebase。这似乎是firebase android客户端中的一个错误。要避免此错误,请使用firebase android客户端版本2.5.0
而不是我假设您现在使用的2.5.1
。