You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Android Studio Live Edit时应用崩溃问题求助

Android Studio Live Edit 导致应用崩溃,无Gradle/Manifest修改记录

Android Studio的Live Edit功能直接导致应用崩溃,但找不到原因。我没有修改过Gradle或Manifest文件,却出现了这个故障。

Logcat 日志信息

Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 12176 (e.waterreminder), pid 12176 (e.waterreminder)
Cmdline: com.example.waterreminder
pid: 12176, tid: 12176, name: e.waterreminder  >>> com.example.waterreminder <<<
NOTE: Function names and BuildId information is missing for some frames due
NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
NOTE: found under the lib/ directory are readable.
NOTE: On this device, run setenforce 0 to make the libraries readable.
NOTE: Unreadable libraries:
NOTE:   /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#01 pc 000000000007b4ec  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#02 pc 00000000000b46b3  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#03 pc 0000000000072076  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#04 pc 00000000000b626b  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#05 pc 00000000000a7d2f  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#06 pc 0000000000091514  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#07 pc 0000000000072839  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#08 pc 00000000000611e4  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#54 pc 00000000000b75f4  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#55 pc 0000000000057ebe  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#56 pc 00000000000581f3  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#57 pc 0000000000061cf9  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#58 pc 000000000006198e  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#59 pc 0000000000061811  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#60 pc 0000000000066d1d  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#61 pc 0000000000065fd3  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#62 pc 000000000005721c  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so
#63 pc 00000000000578f4  /data/data/com.example.waterreminder/code_cache/startup_agents/7cce5689-agent.so

已尝试的解决方法

  • 开启应用设置中的「Always install with package manager」选项,未解决问题

Build Gradle 代码

plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.jetbrainsKotlinAndroid)
    //Kapt
    id("kotlin-kapt")
    //Hilt
    id("com.google.dagger.hilt.android")
}

android {
    namespace = "com.example.waterreminder"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.example.waterreminder"
        minSdk = 26
        targetSdk = 34
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary = true
        }
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
    buildFeatures {
        compose = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.1"
    }
    packaging {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
}

dependencies {

    //DataStore impl
    implementation(libs.androidx.datastore.preferences)
    //Room db impl
    implementation(libs.androidx.room.ktx)
    implementation(libs.firebase.storage.ktx)
    implementation(libs.androidx.material3.android)
    //noinspection KaptUsageInsteadOfKsp
    kapt(libs.androidx.room.compiler)
    //Hilt impl
    implementation(libs.hilt.android)
    kapt(libs.hilt.android.compiler)
    implementation(libs.androidx.hilt.navigation.compose)
    //Coil impl
    implementation(libs.coil.compose)
    //Nav impl
    implementation(libs.androidx.lifecycle.runtime.compose)
    implementation(libs.androidx.navigation.compose)
    implementation(libs.accompanist.navigation.animation)
    //System bars color impl
    implementation(libs.accompanist.systemuicontroller)

    //Basic impl
    implementation(libs.androidx.animation.graphics.android)
    implementation(libs.androidx.appcompat)
    implementation(libs.androidx.graphics.shapes.android)
    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.lifecycle.runtime.ktx)
    implementation(libs.androidx.activity.compose)
    implementation(platform(libs.androidx.compose.bom.v20240401))
    implementation("androidx.compose.ui:ui")
    implementation("androidx.compose.ui:ui-graphics")
    implementation("androidx.compose.ui:ui-tooling-preview")
    implementation("androidx.compose.material3:material3")
    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)
    androidTestImplementation(platform(libs.androidx.compose.bom.v20240401))
    androidTestImplementation("androidx.compose.ui:ui-test-junit4")
    debugImplementation("androidx.compose.ui:ui-tooling")
    debugImplementation("androidx.compose.ui:ui-test-manifest")
    implementation(kotlin("reflect"))
}

内容的提问来源于stack exchange,提问作者Егор Сауткин

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 21:23:10