Jagdish Choudhary
Jagdish Choudhary

Reputation: 147

Android app crashing without any error in logcat

My app is crashing without giving any error. I have only one week to launch my app but at this time I am not able to track where is the error.Here is my logcat.

        05-06 16:12:49.778 7063-7063/? I/art: Late-enabling -Xcheck:jni
05-06 16:12:49.842 7063-7063/com.cofoz.cofoz W/System: ClassLoader referenced unknown path: /data/app/com.cofoz.cofoz-1/lib/arm
05-06 16:12:49.920 7063-7063/com.cofoz.cofoz D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
05-06 16:12:49.975 7063-7063/com.cofoz.cofoz V/FA: Registered activity lifecycle callback
05-06 16:12:49.976 7063-7063/com.cofoz.cofoz I/FirebaseInitProvider: FirebaseApp initialization successful
05-06 16:12:50.020 7063-7099/com.cofoz.cofoz V/FA: Collection enabled
05-06 16:12:50.022 7063-7099/com.cofoz.cofoz V/FA: App package, google app id: com.cofoz.cofoz, 1:469934280646:android:3c290afc0d1894b6
05-06 16:12:50.024 7063-7099/com.cofoz.cofoz I/FA: App measurement is starting up, version: 12451
    To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
    To enable faster debug mode event logging run:
      adb shell setprop debug.firebase.analytics.app com.cofoz.cofoz
05-06 16:12:50.024 7063-7099/com.cofoz.cofoz D/FA: Debug-level message logging enabled
05-06 16:12:50.030 7063-7063/com.cofoz.cofoz W/Settings: Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
05-06 16:12:50.039 7063-7099/com.cofoz.cofoz V/FA: Cancelling job. JobID: 8573555
05-06 16:12:50.042 7063-7099/com.cofoz.cofoz V/FA: Persisting first open: 1525603369923
05-06 16:12:50.126 7063-7099/com.cofoz.cofoz V/FA: Updating deferred analytics collection: false
05-06 16:12:50.221 7063-7063/com.cofoz.cofoz W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
05-06 16:12:50.224 7063-7063/com.cofoz.cofoz V/FA: onActivityCreated
05-06 16:12:50.319 7063-7063/com.cofoz.cofoz W/Firestore: (0.6.6-dev) [Firestore]: The behavior for java.util.Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK.
    To hide this warning and ensure your app does not break, you need to add the following code to your app before calling any other Cloud Firestore methods:

    FirebaseFirestore firestore = FirebaseFirestore.getInstance();
    FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder()
        .setTimestampsInSnapshotsEnabled(true)
        .build();
    firestore.setFirestoreSettings(settings);

    With this change, timestamps stored in Cloud Firestore will be read back as com.google.firebase.Timestamp objects instead of as system java.util.Date objects. So you will also need to update code expecting a java.util.Date to instead expect a Timestamp. For example:

    // Old:
    java.util.Date date = snapshot.getDate("created_at");
    // New:
    Timestamp timestamp = snapshot.getTimestamp("created_at");
    java.util.Date date = timestamp.toDate();

    Please audit all existing usages of java.util.Date when you enable the new behavior. In a future release, the behavior will be changed to the new behavior, so if you do not follow these steps, YOUR APP MAY BREAK.
05-06 16:12:50.323 7063-7063/com.cofoz.cofoz D/AndroidRuntime: Shutting down VM
05-06 16:12:50.402 7063-7127/com.cofoz.cofoz W/linker: /data/app/com.google.android.gms-1/lib/arm/libconscrypt_gmscore_jni.so: unused DT entry: type 0xf arg 0x194
05-06 16:12:50.405 7063-7127/com.cofoz.cofoz V/NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 280 native methods...
05-06 16:12:50.482 7063-7085/com.cofoz.cofoz I/art: Starting a blocking GC HeapTrim
05-06 16:12:50.484 7063-7127/com.cofoz.cofoz D/NetworkSecurityConfig: No Network Security Config specified, using platform default
05-06 16:12:50.487 7063-7127/com.cofoz.cofoz I/ProviderInstaller: Installed default security provider GmsCore_OpenSSL
05-06 16:12:51.871 7063-7080/? I/art: Debugger is no longer active
    Starting a blocking GC Instrumentation
05-06 16:12:52.128 7063-7099/? V/FA: Checking service availability
05-06 16:12:52.130 7063-7099/? V/FA: Service available
    Setting useService: true
05-06 16:12:52.132 7063-7099/? V/FA: Connecting to remote service
05-06 16:12:52.143 7063-7099/? V/FA: Connection attempt already in progress

Here is my app gradle file. I am using firebase as my backend. Sometimes it does give my error of FirebaseInstanceID TOKEN RETRIVAL FAILED

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.cofoz.cofoz"
        buildToolsVersion '27.0.3'
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 5
        versionName "1.0.3"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    useLibrary 'org.apache.http.legacy'
    dexOptions {
        javaMaxHeapSize "2g"
        preDexLibraries true

        jumboMode true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            // Disables PNG crunching for the release build type.
            crunchPngs false

        }
    }
    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
    buildToolsVersion '27.0.3'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v13:27.1.1'
    implementation 'com.android.support:animated-vector-drawable:27.1.1'
    implementation 'com.android.support:mediarouter-v7:27.1.1'
    implementation 'com.android.support:support-compat:27.1.1'
    implementation 'com.android.support:support-dynamic-animation:27.1.1'
    implementation 'com.android.support:palette-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:animated-vector-drawable:27.1.1'
    implementation 'com.android.support:customtabs:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.firebase:firebase-core:15.0.2'
    implementation 'com.github.andremion:counterfab:1.0.1'
    implementation 'com.firebaseui:firebase-ui-auth:3.3.1'
    implementation 'com.google.firebase:firebase-auth:15.1.0'
    //implementation 'com.jakewharton:butterknife:8.8.1'
    implementation 'com.firebaseui:firebase-ui-firestore:3.3.1'
    implementation 'com.google.firebase:firebase-firestore:16.0.0'
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    // Required only if Facebook login support is required
    //implementation 'com.facebook.android:facebook-android-sdk:4.27.0'
    //implementation 'com.github.DanielMartinus:Stepper-Touch:0.6'
    //implementation 'com.stone.vega.library:VegaLayoutManager:1.0.6'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.squareup.okhttp3:okhttp:3.8.1'
    implementation 'com.squareup.okhttp:okhttp:2.5.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    //implementation'com.google.firebase:firebase-invites:15.0.0'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.airbnb.android:lottie:2.2.5'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    //implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
    //implementation 'com.github.GrenderG:Toasty:1.2.8'
    implementation 'com.github.d-max:spots-dialog:0.4@aar'
    implementation 'com.wdullaer:materialdatetimepicker:3.5.0'
    //implementation 'com.github.ganfra:material-spinner:2.0.0'
    //implementation 'com.google.android.gms:play-services-identity:15.0.0'
    //implementation 'com.github.thomper:sweet-alert-dialog:v1.4.0'
    // Shimmer
    implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
    implementation 'com.karumi:dexter:4.2.0'
    implementation 'com.google.android.gms:play-services-places:15.0.1'
    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
    implementation 'com.github.medyo:android-about-page:1.2.4'
    implementation 'net.danlew:android.joda:2.9.9.3'
    implementation 'com.instabug.library:instabug:4.13.1'
    implementation 'org.apache.directory.studio:org.apache.commons.io:2.4'
    implementation('com.github.bumptech.glide:glide:4.7.1') {
        exclude group: "com.android.support"
    }
    implementation('com.twitter.sdk.android:twitter-core:3.2.0@aar') { transitive = true }
}

apply plugin: 'com.google.gms.google-services'

The debugger also saying DEAD just after installing. Please help me with this.

Upvotes: 0

Views: 3642

Answers (2)

Jozef
Jozef

Reputation: 1264

I faced the similar problem with the following warning in my logs:

W/Firestore: (0.6.6-dev) [Firestore]: The behavior for java.util.Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK.
         To hide this warning and ensure your app does not break, you need to add the following code to your app before calling any other Cloud Firestore methods:

         FirebaseFirestore firestore = FirebaseFirestore.getInstance();
         FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder()
             .setTimestampsInSnapshotsEnabled(true)
             .build();
         firestore.setFirestoreSettings(settings);

         With this change, timestamps stored in Cloud Firestore will be read back as com.google.firebase.Timestamp objects instead of as system java.util.Date objects. So you will also need to update code expecting a java.util.Date to instead expect a Timestamp. For example:

         // Old:
         java.util.Date date = snapshot.getDate("created_at");
         // New:
         Timestamp timestamp = snapshot.getTimestamp("created_at");
         java.util.Date date = timestamp.toDate();

         Please audit all existing usages of java.util.Date when you enable the new behavior. In a future release, the behavior will be changed to the new behavior, so if you do not follow these steps, YOUR APP MAY BREAK.

It sounds weird to me because it suggests to replace Date data type with Timestamp but I currently don't have any Date (or even Timestamp) data types in my DB model.

I solved it as suggested: setTimestampsInSnapshotsEnabled(true). Looks like Date type will not be supported any longer.

Upvotes: 2

Denis Loh
Denis Loh

Reputation: 2224

It seems, that the app crashes in native code:

05-06 16:12:50.323 7063-7063/com.cofoz.cofoz D/AndroidRuntime: Shutting down VM
05-06 16:12:50.402 7063-7127/com.cofoz.cofoz W/linker: /data/app/com.google.android.gms-1/lib/arm/libconscrypt_gmscore_jni.so: unused DT entry: type 0xf arg 0x194

When you open the logcat in Android Studio, switch of the filter "Show only selected application" to show all log lines. It may tell you what crashed exactly. Often, with native code, an incompatible library was used, or the library only ships with ARMv7a, but you try to run the app on the emulator which is often X86.

Hope it helps.

Upvotes: 1

Related Questions