Gradle is a build system used to build Android apps. Android developers use Android Studio and Gradle to build Android apps. Now with Flutter the future of mobile development, we develop one app (Dart language) and it runs on three platforms(Android, iOS, and Web). We need to learn Flutter and Gradle configuration. Fun fact: as a software engineer you need to learn to use different programming languages, IDE tools, build systems, etc... When building Android apps the thing that changes the most is the UI layer of the app, everyday there is a new library. The build process when building new Android apps does not change often Gradle. In the last 2–3 years, the biggest change I have seen in the Android build process was to publish the App Bundle(.aab) instead of App APK (.apk).
Build Debug APK:
- Create a new Flutter project.
- To run Gradle tasks on your Flutter project, using VScode open the terminal and enter the below commands:
Build a debug app:
- Gradle build command generates the app file app-debug.apk.
- Go to directory /build/app/outputs/apk/debug.
- Drag and drop file app-debug.apk to Android device, or use Adb command $adb install app-debug.apk.
Clean Android project:
- Deletes all build and output directories and files created.
All the Gradle tasks in the project enter:
./gradlew tasks — all
./gradlew tasks — all | grep app
Thanks for reading. I started to publish my Flutter notes. Let me know if I’m wrong somewhere. I’m open to your feedback 🙌🏻