Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android studio logcat does not show the reason of crashes when i run my app on a real phone

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 {
    ....
}
like image 255
Hadi Avatar asked Feb 05 '18 11:02

Hadi


People also ask

Why is my Logcat not showing anything in Android?

Go to the File option > click on “INVALIDATE CACHES/RESTART” then a dialog box will pop up, Select the “INVALIDATE CACHES/RESTART” button. This will automatically restart and build the index of android studio.

Why does my app keep crashing in Android Studio?

An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java or Kotlin crashes if it throws an unhandled exception, represented by the Throwable class.


1 Answers

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

like image 183
Abhishek kumar Avatar answered Sep 18 '22 14:09

Abhishek kumar