Flutter: Could not create task ':generateLockfiles'. Problem with gradlew.bat in Windows
Asked Answered
B

2

1

Error is: "The supplied phased action failed with an exception. Could not create task ':generateLockfiles'. Cannot run program "C:\Users...\android/gradlew.bat". CreateProcess error=2, The system cannot find the file specified."

Flutter doctor shows only one problem: It sais that the android phone emulator has issues to run. And that is of course the case when I have problems in my android/gradle folder/files. Don't know what I can do here...

Barometrograph answered 1/10, 2022 at 8:46 Comment(0)
S
1

build.gradle error: Could not create tastk ':generateLockfiles'. in Flutter project but App is running normal

According to these answers I have first run the 'flutter doctor/ flutter clean / flutter pub get ' and those were not enough for m situation. So I have also opened the project in Android studio and then open it with VS Code or etc. It worked at the end, Good luck.

Stans answered 24/10, 2022 at 19:52 Comment(0)
T
0
  • Just open the project in Android Studio, that should update any files you may need in the android\build.gradle file. Important note: Open the actual android/ folder, not just your root Flutter project.

  • You will see probably something like this:

    enter image description here

  • After the update, re-run VSCode and the Android Emulator. You may need to re-start your system.

  • The changes were as follows:

    enter image description here

Related Issues

Trunnion answered 9/11, 2023 at 23:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.