I’m facing a very confusing issue with my Flutter project. Every time I run flutter build apk
, it gives me the same APK as the first time I built it, even after making changes to the code. Interestingly, everything works fine when I run the app on the Android Studio emulator using adb
. Here are the steps I’ve taken to try to resolve this issue:
- Cleaned the project and cache:
./gradlew clean
./gradlew --stop
rm -rf $HOME/.gradle/caches/
flutter clean
flutter pub get
flutter build apk
- Updated the Flutter version:
flutter upgrade
- Verified my Flutter setup using flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.2, on Linux Mint 21.3 6.8.0-35-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.90.2)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
- Tried to set versionCode and versionName from pubspec.yaml:
version: 1.0.1+5
Even after all these steps, I still get the same APK every time I build. The changes I make to the code do not reflect in the new builds.
Interestingly, everything works fine when I run the app on the Android Studio emulator using adb
.
Has anyone encountered a similar issue or have any ideas on how to resolve this? Any help would be greatly appreciated.
Feel free to suggest any further steps or troubleshooting methods. Thank you!