Solutions to Flutter error: Gradle task assembleDebug failed with exit code 1

For creating an apk for Android in Flutter this issue sometimes happens. I had the luck of facing this issue as well. Here are the few ways it can be solved: Due to androidX If you followed recommended route from here: https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility Try this: Check with steps in “not recommended” way in above tutorial if every listed files is same as in your project, especially : inroot/android/gradle/wrapper/gradle-wrapper.properties setdistributionUrl=https\://services.gradle.org/distributions/gradle-7.10.0-all.zip in root/android/build....