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

Android Studio构建失败:无法解析org.jetbrains.kotlin:kotlin-reflect:1.3.72依赖问题求助

Fix for Gradle Build Failure: Cannot Create Kotlin-Reflect Cache Directory

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:

    1. Close Android Studio completely
    2. Navigate to C:\Users\admin\.gradle\caches and delete all files/folders inside it
    3. Reopen Android Studio, go to File > Invalidate Caches..., check all boxes, then click Invalidate and Restart
  • Check Directory Permissions
    Your user account might not have write access to the .gradle folder:

    1. Right-click on C:\Users\admin\.gradle and select Properties > Security
    2. Make sure the admin user has Write or Full Control permissions
    3. If permissions are missing, click Edit to add them, then save changes
  • Manually Add the Dependency (Emergency Fix)
    If cache/permission fixes don’t work, manually place the dependency in your local repo:

    1. Get the kotlin-reflect-1.3.72.jar and its corresponding .pom file
    2. Create the directory path C:\Users\admin\.m2\repository\org\jetbrains\kotlin\kotlin-reflect\1.3.72 if it doesn’t exist
    3. Place both files in that directory, then re-run the build
  • 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:

    1. 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)
    2. Match it with a compatible Kotlin version (e.g., 1.7.20) in the same file
    3. Sync your project and rebuild

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.01 01:42:33