【问题标题】:debug build cannot access out.jar during build because it is being use by another process调试构建在构建期间无法访问 out.jar,因为它正在被另一个进程使用
【发布时间】:2020-07-10 05:51:34
【问题描述】:
现在我在家工作,当我尝试运行调试版本时,我正在尝试为我的家庭桌面(Windows)工作。我得到了错误。
Execution failed for task ':app:packageDebug'.
> Exception modifying resource jar file: : D:\Dev\APPFOLDER\app\build\intermediates\merged_java_res\debug\out.jar: The process cannot access the file because it is being used by another process.
我不明白发生了什么我可以在我的笔记本电脑 (Mac) 上正常运行构建。我什至已经完全恢复出厂设置我的电脑。
【问题讨论】:
标签:
android
android-studio
debug-build
【解决方案1】:
我还没有想出如何解决这个问题,但问题在于com.heapanalytics.android 我现在已经禁用了堆。
【解决方案2】:
这发生在我身上,如果你在运行时初始化它,可以通过将它添加到你的 build.gradle 来解决它。
android {
defaultConfig {
// Add this section to enable Heap event capture.
ext {
heapEnabled = true
}
// ...
}
// ...
}
【解决方案3】:
嗨@Donovan,当我开始从Windows 更新我的项目时,我也遇到了同样的问题。同一个项目运行良好,并且能够在 mac os 中构建 apk。
因为你的回答,终于查明原因了。谢谢并查看以下解决方案。
当前系统操作系统:Windows 10
我的解决方案:
---Nb:只有禁用堆分析才会起作用。但我尝试了以下步骤与堆分析并为我工作。
- 使用最新版本更新了所有依赖项(仅更新 lib 不能解决问题:但建议这样做)。
- 在项目级别
build.gradle 中更新'com.heapanalytics.android' 版本(**非常重要)。就我而言,我更新到版本“1.7.0”
- 在项目级别更新 google play 服务版本
build.gradle
- 如果以前没有包括在清单中添加权限。这是为了
firebase 分析实例。