【问题标题】:Failed to capture fingerprint of input files for task ':checkDevClasspath' property 'compileClasspath' during up-to-date check在最新检查期间未能捕获任务“:checkDevClasspath”属性“compileClasspath”的输入文件的指纹
【发布时间】:2019-06-04 17:34:31
【问题描述】:

我正在尝试在 Android Studio 中升级到 gradle 3.2.1,但 gradle 构建失败并出现以下错误。

 FAILURE: Build failed with an exception.

 * What went wrong:
 Failed to capture the fingerprint of input files for task ':checkDevDebugClasspath' property 'compileClasspath' during the up-to-date check.
 > 1

 * Try:
  Run with --scan to get full insights.

 * Exception is:
 org.gradle.api.UncheckedIOException: Failed to capture fingerprint of input files for task ':checkDevDebugClasspath' property 'compileClasspath' during up-to-date check.
    at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.fingerprintTaskFiles(CacheBackedTaskHistoryRepository.java:360)
    at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.createExecution(CacheBackedTaskHistoryRepository.java:163)

不知道发生了什么

【问题讨论】:

  • 尝试连续运行几次。它对我有用

标签: java android android-studio gradle android-gradle-plugin


【解决方案1】:

我知道这是一个老问题,但我多次遇到它,并以不同的方式解决了它。 这可能是由多种原因造成的,但这意味着构建项目时使用的资源(模块)缺失。

如果您使用的是纯安卓;我建议清理项目,然后按如下方式重建它:

cd android
./gradlew clean assemble

关于 android 的注意事项;如果您依赖其他模块,请确保它们存在并正确设置。还要确保您没有任何损坏的符号链接。

如果您使用的是 react-native,您可以清理 android 和 node_modules 并重新构建。大多数损坏的依赖项将在 node_modules 中:

rm -rf node_modules
yarn install # Or npm install if you aren't using yarn
cd android
./gradlew clean
cd ..
react-native run-android # Or expo start if you are on expokit

关于 react-native 的注意事项; 确保您使用的是有效版本的 nodejs 并且节点模块已成功安装。对我来说,这个问题大部分时间是因为我使用了更新的 nodejs 版本并且没有正确安装节点模块。

【讨论】:

    猜你喜欢
    • 2019-06-09
    • 2019-12-25
    • 2020-01-09
    • 2018-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多