My React-Native project build fails in Android Studio by showing exception "Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0."

I’m working on a “React-Native” project and it is not building the project in Android Studio by showing the error “Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.”

And the issue is accessing the file as it is showing “The process cannot access the file because it is being used by another process.”

When I build the project, it shows the exception as under:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> java.nio.file.FileSystemException: E:\TrackFriends\android\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_: The process cannot access the file because it is being used by another process.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
43 actionable tasks: 2 executed, 41 up-to-date

The main problem is with this line:

java.nio.file.FileSystemException: E:\TrackFriends\android\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_: The process cannot access the file because it is being used by another process.

As I’ve tried every possible way to resolve this issue but same error.

I have the exact same issue. Did you end up finding a fix for it?

My problem was with JDK file which was open at the back-end and was using that library, I simply “end that task” from “Task Manager”. And my problem was solved.

thanks for the response. i fixed my issue by deleting the app from my phone completely and rebuilding it.