16

I have a strange problem. when I run my app on Genymotion with android 4.1, everything is good and Logcat works fine and shows everything. but when I run the same app on a real phone(Huawei honour 7 with Android 6), and my app gets crash, logCat does not show the reason for that crash. in the other word, log cat does not show Exceptions. can anyonehelp me?thanks

maybe be useful:

logCat After a crash: Photo

build.gradle(module app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "my.application.id"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    ....
}
Hadi
  • 544
  • 1
  • 8
  • 28

1 Answers1

8

Best way to fix this to invalidate caches, may it will worked for you.

Go to FILE -> click "INVALIDATE CACHES/RESTART" then a dialog box will pop-up, Select "INVALIDATE CACHES/RESTART" button.

Android studio will automatically restart and rebuild the index.

or,

You can do the following things.

  1. Restart logcat
  2. Change from verbose to debug/error.
  3. The last (Checked the regex ) Change the regex to show selected options only.

or, Look into this Logcat not showing errors from my Huawei P9 phone

Abhishek kumar
  • 4,347
  • 8
  • 29
  • 44
  • i tried all but now workd. the post edited. I've attached a screen of logcat after a crash. – Hadi Feb 05 '18 at 14:24
  • i tried all but not worked. the post edited. I've attached a screen of logcat after a crash. – Hadi Feb 05 '18 at 15:45
  • thanks my friend. my problem solved with https://stackoverflow.com/questions/42691076/logcat-not-showing-errors-from-my-huawei-p9-phone/43557441. thanks a lot. – Hadi Feb 05 '18 at 16:10
  • 2
    Welcome, @Hadi , on my first comment i already told its phone issue BTW, Happy Coding.. – Abhishek kumar Feb 05 '18 at 16:34