Android Java lib中的原因不明的NPE(空指针异常)

时间:2018-01-31 13:47:27

标签: java android crashlytics firebase-crash-reporting

我正在使用Firebase崩溃报告和Crashlytics开发Java中的Android移动应用程序,我得到一个非常奇怪的错误,似乎来自lib,我不知道如何更详细地研究它。 / p>

我尝试通过升级和降级libs版本来更改我的Gradle文件,但Firebase CrashReporting和Crashlytics仍然报告错误。报告为NullPointerException,但没有更多细节......

我查看了Stackoverflow,但我发现的任何解决方案都适用于我的情况......你能看看并告诉我是否有人知道如何解决它?

以下是详细信息:

  • 报告的崩溃如下所示:crash reporting
  • 我得到的唯一信息是:


 Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase(java.util.Locale)' on a null object reference
bpc.run

 Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase(java.util.Locale)' on a null object reference
bpc.run
keyboard_arrow_down
Plantage : TubeSockReader-1 #1
keyboard_arrow_up
bpc.run (:com.google.android.gms.DynamiteModulesC:56)
java.lang.Thread.run (Thread.java:818)
TubeSockReader-1 #2
keyboard_arrow_up
java.lang.Object.wait (Object.java)
java.lang.Thread.parkFor$ (Thread.java:1220)
sun.misc.Unsafe.park (Unsafe.java:299)
java.util.concurrent.locks.LockSupport.park (LockSupport.java:158)
java.util.concurrent.FutureTask.awaitDone (FutureTask.java:421)
java.util.concurrent.FutureTask.get (FutureTask.java:163)
com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait (CrashlyticsBackgroundWorker.java:43)
com.crashlytics.android.core.CrashlyticsController.handleUncaughtException (CrashlyticsController.java:311)
com.crashlytics.android.core.CrashlyticsController$6.onUncaughtException (CrashlyticsController.java:295)
com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException (CrashlyticsUncaughtExceptionHandler.java:30)
com.google.firebase.crash.FirebaseCrash$zzc.uncaughtException (Unknown Source)
java.lang.ThreadGroup.uncaughtException (ThreadGroup.java:693)
java.lang.ThreadGroup.uncaughtException (ThreadGroup.java:690)
pool-5-thread-1 #3
keyboard_arrow_up
java.lang.Object.wait (Object.java)
java.lang.Thread.parkFor$ (Thread.java:1220)
sun.misc.Unsafe.park (Unsafe.java:299)
java.util.concurrent.locks.LockSupport.park (LockSupport.java:158)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2013)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:1078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:1071)
java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1038)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1098)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
java.lang.Thread.run (Thread.java:818)
HeapTaskDaemon #4
keyboard_arrow_up
dalvik.system.VMRuntime.runHeapTasks (VMRuntime.java)
java.lang.Daemons$HeapTaskDaemon.run (Daemons.java:355)
java.lang.Thread.run (Thread.java:818)
FinalizerWatchdogDaemon #5
keyboard_arrow_up
java.lang.Thread.sleep (Thread.java)
java.lang.Thread.sleep (Thread.java:1031)
java.lang.Thread.sleep (Thread.java:985)
java.lang.Daemons$FinalizerWatchdogDaemon.sleepFor (Daemons.java:273)
java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization (Daemons.java:284)
java.lang.Daemons$FinalizerWatchdogDaemon.run (Daemons.java:232)
java.lang.Thread.run (Thread.java:818)
pool-11-thread-1 #6
keyboard_arrow_up
java.lang.Object.wait (Object.java)
java.lang.Thread.parkFor$ (Thread.java:1220)
sun.misc.Unsafe.park (Unsafe.java:299)
java.util.concurrent.locks.LockSupport.park (LockSupport.java:158)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2013)
java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:410)
java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1038)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1098)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
java.lang.Thread.run (Thread.java:818)
main #7
keyboard_arrow_up
android.content.res.AssetManager.openNonAssetNative (AssetManager.java)
android.content.res.AssetManager.openNonAsset (AssetManager.java:405)
android.content.res.Resources.loadDrawableForCookie (Resources.java:2633)
android.content.res.Resources.loadDrawable (Resources.java:2540)
android.content.res.TypedArray.getDrawable (TypedArray.java:870)
android.widget.ImageView.<init> (ImageView.java:152)
android.widget.ImageView.<init> (ImageView.java:140)
android.widget.ImageView.<init> (ImageView.java:136)
java.lang.reflect.Constructor.newInstance (Constructor.java)
android.view.LayoutInflater.createView (LayoutInflater.java:619)
com.android.internal.policy.PhoneLayoutInflater.onCreateView (PhoneLayoutInflater.java:58)
android.view.LayoutInflater.onCreateView (LayoutInflater.java:694)
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:762)
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:704)
android.view.LayoutInflater.rInflate (LayoutInflater.java:835)
android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:798)
android.view.LayoutInflater.rInflate (LayoutInflater.java:838)
android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:798)
android.view.LayoutInflater.rInflate (LayoutInflater.java:838)
android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:798)
android.view.LayoutInflater.rInflate (LayoutInflater.java:838)
android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:798)
android.view.LayoutInflater.inflate (LayoutInflater.java:515)
android.view.LayoutInflater.inflate (LayoutInflater.java:423)
android.view.LayoutInflater.inflate (LayoutInflater.java:374)
com.android.internal.policy.PhoneWindow.setContentView (PhoneWindow.java:393)
android.app.Activity.setContentView (Activity.java:2172)
com.dap.view.onboarding.OnboardingActivity.onCreate (OnboardingActivity.java:103)
android.app.Activity.performCreate (Activity.java:6251)
android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1107)
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2369)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2476)
android.app.ActivityThread.-wrap11 (ActivityThread.java)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1344)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5421)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)
OkHttp ConnectionPool #8
java.lang.Object.wait
keyboard_arrow_down
FinalizerDaemon #9
android.content.res.AssetManager$AssetInputStream.close
keyboard_arrow_down
pool-3-thread-1 #10
java.lang.Object.wait
keyboard_arrow_down
pool-9-thread-1 #11
java.lang.Object.wait
keyboard_arrow_down
Crashlytics Report Uploader #12
java.lang.Thread.sleep
keyboard_arrow_down
Queue #13
java.lang.Object.wait
keyboard_arrow_down
ReferenceQueueDaemon #14
java.lang.Object.wait
keyboard_arrow_down
Answers Events Handler1 #15
java.lang.Object.wait
keyboard_arrow_down
Measurement Worker #16
android.content.res.AssetManager.list
keyboard_arrow_down
pool-12-thread-1 #17
java.lang.Object.wait
keyboard_arrow_down
Queue #18
java.lang.Object.wait
keyboard_arrow_down
AsyncTask #1 #19
java.lang.Object.wait
keyboard_arrow_down
GoogleApiHandler #20
android.os.MessageQueue.nativePollOnce
keyboard_arrow_down
Crashlytics Exception Handler1 #21
dalvik.system.VMStack.getThreadStackTrace
keyboard_arrow_down
AsyncTask #2 #22
java.lang.Object.wait
keyboard_arrow_down
pool-13-thread-1 #23
com.android.org.conscrypt.NativeCrypto.SSL_read
keyboard_arrow_down
FirebaseDatabaseWorker #24
java.lang.Object.wait
keyboard_arrow_down
pool-8-thread-1 #25
java.lang.Object.wait
keyboard_arrow_down

这是我的gradle file

apply plugin: 'com.android.application'

apply plugin: 'io.fabric'

android {
    compileSdkVersion 25
    buildToolsVersion '26.0.1'
    defaultConfig {
        applicationId "com.dap"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 73
        versionName "1.8.12"
        renderscriptTargetApi 19
        renderscriptSupportModeEnabled true
        testInstrumentationRunner 
 "com.android.test.runner.MultiDexTestRunner"
    multiDexEnabled true
}
buildTypes {

    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

    }
    productFlavors {
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}
repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.android.gms:play-services:11.8.0'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.firebase:geofire-android:2.1.0'

    compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
        transitive = true;
    }

    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-messaging:11.8.0'
    compile 'com.google.firebase:firebase-storage:11.8.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.google.firebase:firebase-database:11.8.0'
    compile 'com.google.android.gms:play-services-location:11.8.0'
    compile 'com.baoyz.swipemenulistview:library:1.3.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:support-fragment:25.2.0'
    compile 'com.android.support:support-vector-drawable:25.2.0'
    compile 'com.android.support:animated-vector-drawable:25.2.0'
    compile 'com.android.support:recyclerview-v7:25.2.0'
    compile 'com.android.support:percent:25.2.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'me.himanshusoni.chatmessageview:chat-message-view:1.0.3'
    compile 'com.makeramen:roundedimageview:2.3.0'
    compile 'com.github.bumptech.glide:glide:3.5.2'
    compile 'com.github.warkiz.widget:indicatorseekbar:1.1.2'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
            details.useVersion '25.3.0'
            }
        }
    }
}

0 个答案:

没有答案