相关文章推荐
傻傻的甘蔗  ·  [PHP] ...·  2 年前    · 
有腹肌的围巾  ·  Android ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Failed to capture fingerprint of input files for task ':checkDevClasspath' property 'compileClasspath' during up-to-date check

Ask Question

I'm trying to upgrade to gradle 3.2.1 in Android Studio, but the gradle build is failing with the below error.

 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.
 * 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)

Not sure what is happening

I know this is an old issue but I faced it several times and I fixed it in different ways. This can be caused by several things but it means that there are missing resources (modules) used in building your project.

if you are using pure android; I suggest cleaning the project then rebuilding it as follows:

cd android
./gradlew clean assemble

Note on android; If you are depending on other modules, make sure they exist and correctly set up. Also make sure you don't have any broken symlinks.

if you are using react-native you can clean android and node_modules and rebuild. Mostly the broken dependencies will be in 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

Note on react-native; make sure you are using a valid version of nodejs and the node modules are installed successfully. For me most of the time the issue was because I used updated nodejs version and the node modules weren't installed correctly.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.