1

我有一个奇怪的崩溃错误,不是在调试 apk 上发生,而是在调用 authWithPassword 时在签名 apk 上崩溃。

这是崩溃日志。SSL 出了点问题

E/Firebase(22682): An unexpected error occurred. Please contact support@firebase.com. Details: 
E/Firebase(22682): java.lang.NullPointerException
E/Firebase(22682):  at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:382)
E/Firebase(22682):  at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:165)
E/Firebase(22682):  at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
E/Firebase(22682):  at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
E/Firebase(22682):  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
E/Firebase(22682):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
E/Firebase(22682):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:653)
E/Firebase(22682):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:627)
E/Firebase(22682):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:616)
E/Firebase(22682):  at com.firebase.client.authentication.AuthenticationManager$8.run(AuthenticationManager.java:450)
E/Firebase(22682):  at com.firebase.client.android.AndroidPlatform$2.run(AndroidPlatform.java:76)
W/dalvikvm(22682): threadid=18: thread exiting with uncaught exception (group=0x4172de48)

这是我的 gradle 文件

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.exmaple.app"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 11
        versionName "1.0.3"
    }
    buildTypes {
        release {
            minifyEnabled false
            lintOptions {
                disable 'MissingTranslation'
            }
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
    }
}

dependencies {
    compile project(':volley')
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    //android support
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.android.support:palette-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'

    //firebase
    compile 'com.firebase:firebase-client-android:2.4.1'

    //fab
    compile 'com.getbase:floatingactionbutton:1.10.1'

    //picasso image
    compile 'com.squareup.picasso:picasso:2.5.2'

    //circle progress
    compile 'com.github.lzyzsd:circleprogress:1.1.0@aar'

    //parse
    compile 'com.parse.bolts:bolts-android:1.3.0'
    compile 'com.parse:parse-android:1.11.0'

    //for local storage service
    compile 'com.snappydb:snappydb-lib:0.4.0'
    compile 'com.esotericsoftware.kryo:kryo:2.24.0'

    //critercism
    compile 'com.crittercism:crittercism-android-agent:+'

    //google analytics
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
}

请你给我一个提示!谢谢,

4

1 回答 1

1

不知道幕后是什么,但似乎 Firebase 和 Crittercism 之间存在冲突问题。

在init app(onCreate)时,这个命令会导致crash:

Firebase.setAndroidContext(context);
Firebase.getDefaultConfig().setPersistenceEnabled(true);
...
Crittercism.initialize(context, crittercism_key);

但这有效:

Crittercism.initialize(context, crittercism_key);
Firebase.setAndroidContext(context);
Firebase.getDefaultConfig().setPersistenceEnabled(true);
....

最后,它仅在签名 apk 上发生的原因是:

if (!BuildConfig.DEBUG) {
    Crittercism.initialize(context, crittercism_key);
}
于 2015-12-10T07:55:58.490 回答