Android工作室Logcat不会在应用程序崩溃时显示堆栈跟踪

时间:2018-04-19 21:20:01

标签: java android android-studio gradle android-logcat

我刚刚用3.1.1重新安装了Android Studio,但我的初始问题已经解决了,但是,现在我无法在logcat中看到我的错误。我在logcat设置中没有选择过滤器,但它仍然没有显示它们。 Logcat settings

这是我的应用程序级别gradle文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.akhilsukh01.earthquakepreparednessproject"
        minSdkVersion 22
        targetSdkVersion 27
        versionCode 7
        versionName "1.6"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:design:27.1.1'
        implementation 'com.android.support:recyclerview-v7:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.0'
        implementation 'com.android.support:support-v4:27.1.1'

        implementation 'com.rengwuxian.materialedittext:library:2.1.4'

        implementation 'com.google.firebase:firebase-core:15.0.0'
        implementation 'com.google.firebase:firebase-messaging:15.0.0'
        implementation 'com.google.firebase:firebase-database:15.0.0'
        implementation 'com.google.firebase:firebase-storage:15.0.0'
        implementation 'com.google.firebase:firebase-appindexing:15.0.0'
        implementation 'com.firebase:firebase-client-android:2.5.2'

        testImplementation 'junit:junit:4.12'
        implementation 'com.android.support.test:runner:1.0.1'
        implementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    }
    buildToolsVersion '27.0.3'
    productFlavors {
    }
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'

dependencies {
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:gridlayout-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'

    implementation 'com.google.firebase:firebase-messaging:15.0.0'
    implementation 'com.google.firebase:firebase-appindexing:15.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.0'
}

这是我的项目级别gradle文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
        classpath 'com.google.gms:google-services:3.2.1'
        classpath 'io.fabric.tools:gradle:1.25.2'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我知道应用程序级别gradle文件中有许多重复项,但删除其中任何一个都会导致我无法修复的错误(因为日志)。当我使用Firebase Crashlytics时它可以工作,但是如果没有构建失败,我也无法删除它。我还非常感谢您帮助清理我的gradle文件并删除不必要的Firebase实现。

我在日志的末尾得到了这个

read: unexpected EOF!

EDIT1]这是运行工具栏的输出。

04/19 14:15:55: Launching app
$ adb install-multiple -r -t -p com.akhilsukh01.earthquakepreparednessproject C:\Users\akhil\Documents\Apps\EarthquakePreparednessProject\app\build\intermediates\split-apk\debug\slices\slice_4.apk 
Split APKs installed
$ adb shell am start -n "com.akhilsukh01.earthquakepreparednessproject/com.akhilsukh01.earthquakepreparednessproject.IntroHome" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Waiting for process to come online
Connected to process 5201 on device oneplus-one_a2005-ad12fad1

EDIT2]好的,我在模拟器上运行我的应用程序,一切都运行良好。我把它缩小到我的手机就成了问题。我认为这是因为Studio一次接收太多数据导致错误。更具体地说,这个

logcat crashes with read: unexpected EOF

但我还是无法解决它。

0 个答案:

没有答案