Android Studio构建失败:无法解析org.jetbrains.kotlin:kotlin-reflect:1.3.72依赖问题求助
Hey there, I’ve dealt with this exact kind of Gradle cache/permission issue before—let’s walk through how to fix it step by step.
Core Problem Breakdown
From your error log, the root cause is that Gradle can’t create the parent directory for the kotlin-reflect:1.3.72 descriptor file in your local cache. This stops it from resolving the required dependency, which breaks the entire classpath configuration for your project.
Here’s your original error log for reference:
FAILURE: Build failed with an exception. 出错原因:配置根项目‘android’时出现问题。 无法解析配置‘:classpath’的所有构件。 无法解析org.jetbrains.kotlin:kotlin-reflect:1.3.72。 该依赖被以下组件引用: project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.lint:lint-gradle-api:27.0.1 project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1 > com.android.tools:sdk-common:27.0.1 > 无法解析org.jetbrains.kotlin:kotlin-reflect:1.3.72。 > 无法将文件添加至文件存储路径‘C:\Users\admin.gradle\caches\modules-2\metadata-2.95\descriptors’下的‘org.jetbrains.kotlin/kotlin-reflect/1.3.72/edb68b65d2dd9b547bbf59d703899938/descriptor.bin’ > 创建目录‘C:\Users\admin.gradle\caches\modules-2\metadata-2.95\descriptors\org.jetbrains.kotlin\kotlin-reflect\1.3.72\edb68b65d2dd9b547bbf59d703899938’时,无法创建其父目录‘C:\Users\admin.gradle\caches\modules-2\metadata-2.95\descriptors\org.jetbrains.kotlin\kotlin-reflect’ 建议操作: 使用--stacktrace选项获取堆栈跟踪;使用--info或--debug选项获取更多日志输出;使用--scan选项获取完整分析信息;如需更多帮助可访问https://help.gradle.org 本次构建耗时18秒 最终异常:Gradle任务assembleDebug执行失败,退出码为1。
Solutions to Try (in order of ease/effectiveness)
Clean Gradle Cache & Restart Android Studio
Corrupted cache files are the #1 culprit here:- Close Android Studio completely
- Navigate to
C:\Users\admin\.gradle\cachesand delete all files/folders inside it - Reopen Android Studio, go to
File > Invalidate Caches..., check all boxes, then clickInvalidate and Restart
Check Directory Permissions
Your user account might not have write access to the.gradlefolder:- Right-click on
C:\Users\admin\.gradleand selectProperties > Security - Make sure the
adminuser has Write or Full Control permissions - If permissions are missing, click
Editto add them, then save changes
- Right-click on
Manually Add the Dependency (Emergency Fix)
If cache/permission fixes don’t work, manually place the dependency in your local repo:- Get the
kotlin-reflect-1.3.72.jarand its corresponding.pomfile - Create the directory path
C:\Users\admin\.m2\repository\org\jetbrains\kotlin\kotlin-reflect\1.3.72if it doesn’t exist - Place both files in that directory, then re-run the build
- Get the
Upgrade Gradle & Kotlin Versions (Long-Term Fix)
Your current versions (Gradle 4.0.1, Kotlin 1.3.72) are outdated and may have known bugs:- In your project’s root
build.gradle, update the Gradle plugin to a stable newer version (e.g.,com.android.tools.build:gradle:7.4.2) - Match it with a compatible Kotlin version (e.g.,
1.7.20) in the same file - Sync your project and rebuild
- In your project’s root
内容的提问来源于stack exchange,提问作者Israr

