Binder:在集成 firebase 后从活页夹存根实现中捕获了 RuntimeException
Binder: Caught a RuntimeException from the binder stub implementation after integrating firebase
我收到这个错误:
Attempt to invoke interface method 'android.os.IBinder com.mediatek.anrappmanager.IFrameworks.serviceManagerGetService(java.lang.String)' on a null object reference
Logcat:
05-21 01:25:46.136 18093-18115/com.myapp.firbase D/ANRAppManager: !!! It is not under singleton mode, U can't use it. !!!
05-21 01:25:46.139 18093-18115/com.myapp.firbase W/Binder: Caught a RuntimeException from the binder stub implementation.
java.lang.NullPointerException: Attempt to invoke interface method 'android.os.IBinder com.mediatek.anrappmanager.IFrameworks.serviceManagerGetService(java.lang.String)' on a null object reference
at com.mediatek.anrappmanager.ANRManagerNative.b(SourceFile:77)
at com.mediatek.anrappmanager.ANRManagerNative.c(SourceFile:75)
at com.mediatek.anrappmanager.ANRManagerNative$a.get(SourceFile:97)
at com.mediatek.anrappmanager.ANRManagerNative.getDefault(SourceFile:35)
at com.mediatek.anrappmanager.ANRAppManager.dumpMessageHistory(SourceFile:59)
at android.app.ActivityThread$ApplicationThread.dumpMessageHistory(ActivityThread.java:1255)
at android.app.ApplicationThreadNative.onTransact(ApplicationThreadNative.java:691)
at android.os.Binder.execTransact(Binder.java:451)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: java.lang.NullPointerException: Attempt to invoke interface method 'android.os.IBinder com.mediatek.anrappmanager.IFrameworks.serviceManagerGetService(java.lang.String)' on a null object reference
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRManagerNative.b(SourceFile:77)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRManagerNative.c(SourceFile:75)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRManagerNative$a.get(SourceFile:97)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRManagerNative.getDefault(SourceFile:35)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRAppManager.dumpMessageHistory(SourceFile:59)
05-21 01:25:46.144 18093-18115/com.myapp.firbase W/System.err: at android.app.ActivityThread$ApplicationThread.dumpMessageHistory(ActivityThread.java:1255)
05-21 01:25:46.144 18093-18115/com.myapp.firbase W/System.err: at android.app.ApplicationThreadNative.onTransact(ApplicationThreadNative.java:691)
05-21 01:25:46.144 18093-18115/com.myapp.firbase W/System.err: at android.os.Binder.execTransact(Binder.java:451)
依赖关系:
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'me.dm7.barcodescanner:zxing:1.8.3'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'com.google.firebase:firebase-auth:9.0.0'
compile 'com.google.firebase:firebase-crash:9.0.0'
compile 'com.google.firebase:firebase-analytics:9.0.0'
终于找到解决办法了:)
这是因为我将 com.google.android.gms:play-services:9.0.0
指定为依赖项。我几乎引入了所有 Google Play 服务 - 很多!
在我的例子中,我添加了以下依赖项而不是 com.google.android.gms:play-services:9.0.0
compile 'com.google.android.gms:play-services-identity:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-appinvite:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-appindexing:9.0.0'
这里可以找到完整列表here
我的代码中发生了同样的事情。错误说明了一切 "Caught a RuntimeException..."
事实证明,我的代码抛出了一个我没有捕捉到的异常。
我收到这个错误:
Attempt to invoke interface method 'android.os.IBinder com.mediatek.anrappmanager.IFrameworks.serviceManagerGetService(java.lang.String)' on a null object reference
Logcat:
05-21 01:25:46.136 18093-18115/com.myapp.firbase D/ANRAppManager: !!! It is not under singleton mode, U can't use it. !!!
05-21 01:25:46.139 18093-18115/com.myapp.firbase W/Binder: Caught a RuntimeException from the binder stub implementation.
java.lang.NullPointerException: Attempt to invoke interface method 'android.os.IBinder com.mediatek.anrappmanager.IFrameworks.serviceManagerGetService(java.lang.String)' on a null object reference
at com.mediatek.anrappmanager.ANRManagerNative.b(SourceFile:77)
at com.mediatek.anrappmanager.ANRManagerNative.c(SourceFile:75)
at com.mediatek.anrappmanager.ANRManagerNative$a.get(SourceFile:97)
at com.mediatek.anrappmanager.ANRManagerNative.getDefault(SourceFile:35)
at com.mediatek.anrappmanager.ANRAppManager.dumpMessageHistory(SourceFile:59)
at android.app.ActivityThread$ApplicationThread.dumpMessageHistory(ActivityThread.java:1255)
at android.app.ApplicationThreadNative.onTransact(ApplicationThreadNative.java:691)
at android.os.Binder.execTransact(Binder.java:451)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: java.lang.NullPointerException: Attempt to invoke interface method 'android.os.IBinder com.mediatek.anrappmanager.IFrameworks.serviceManagerGetService(java.lang.String)' on a null object reference
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRManagerNative.b(SourceFile:77)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRManagerNative.c(SourceFile:75)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRManagerNative$a.get(SourceFile:97)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRManagerNative.getDefault(SourceFile:35)
05-21 01:25:46.143 18093-18115/com.myapp.firbase W/System.err: at com.mediatek.anrappmanager.ANRAppManager.dumpMessageHistory(SourceFile:59)
05-21 01:25:46.144 18093-18115/com.myapp.firbase W/System.err: at android.app.ActivityThread$ApplicationThread.dumpMessageHistory(ActivityThread.java:1255)
05-21 01:25:46.144 18093-18115/com.myapp.firbase W/System.err: at android.app.ApplicationThreadNative.onTransact(ApplicationThreadNative.java:691)
05-21 01:25:46.144 18093-18115/com.myapp.firbase W/System.err: at android.os.Binder.execTransact(Binder.java:451)
依赖关系:
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'me.dm7.barcodescanner:zxing:1.8.3'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'com.google.firebase:firebase-auth:9.0.0'
compile 'com.google.firebase:firebase-crash:9.0.0'
compile 'com.google.firebase:firebase-analytics:9.0.0'
终于找到解决办法了:)
这是因为我将 com.google.android.gms:play-services:9.0.0
指定为依赖项。我几乎引入了所有 Google Play 服务 - 很多!
在我的例子中,我添加了以下依赖项而不是 com.google.android.gms:play-services:9.0.0
compile 'com.google.android.gms:play-services-identity:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-appinvite:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-appindexing:9.0.0'
这里可以找到完整列表here
我的代码中发生了同样的事情。错误说明了一切 "Caught a RuntimeException..."
事实证明,我的代码抛出了一个我没有捕捉到的异常。