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

无法解析配置':app:debugRuntimeClasspath'文件,Logcat出现AVC权限错误

构建错误解决(Could not resolve all files for configuration ':app:debugRuntimeClasspath')

问题原因

你的依赖配置中,Retrofit相关依赖的版本号前存在多余空格,Gradle无法正确解析带空格的版本号,导致依赖下载失败。

修复步骤

  • 修正依赖格式:将所有带空格的版本号前的空格删除,修正后的依赖如下:
dependencies {
    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation("com.squareup.retrofit2:retrofit:2.9.1")
    implementation("com.squareup.retrofit2:converter-gson:2.9.1")
    implementation "com.squareup.retrofit2:adapter-rxjava2:2.9.1"
    implementation "io.reactivex.rxjava3:rxjava:3.1.5"
    implementation "io.reactivex.rxjava3:rxandroid:3.1.5"
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
}
  • 同步并清理缓存:点击Android Studio顶部的Sync Project with Gradle Files按钮同步项目;如果同步后仍有问题,执行File -> Invalidate Caches...,选择Invalidate and Restart重启IDE,清理Gradle缓存。
  • 检查网络与镜像配置:确保网络可正常访问Maven仓库,若下载缓慢或失败,可在项目根目录的build.gradle中配置国内Maven镜像,示例配置:
allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/public/' }
        google()
        mavenCentral()
    }
}
Logcat权限警告解决(avc: denied { getattr } for path="/proc/dma")

问题说明

该警告是SELinux(安全增强型Linux)的权限限制导致,shell进程尝试访问/proc/dma文件时被拒绝,不会影响应用的正常功能。

处理方案

  • 临时关闭SELinux(仅测试设备):连接设备后打开终端,执行以下命令:
adb shell setenforce 0

注意:设备重启后SELinux会恢复默认状态,该操作仅适用于测试场景。

  • 忽略或过滤日志:若无需关注此类系统级权限警告,可在Logcat中添加过滤规则,屏蔽DetectPable标签的日志,避免干扰开发。

内容的提问来源于stack exchange,提问作者bett

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.22 22:45:11