I am new to flutter facing issues while building and running my Flutter app on an Android device. The app runs perfectly on Chrome using:
flutter run -d chrome
However, when I try to:
Build an APK:
flutter build apk
It fails with errors.
Run on a physical device:
flutter run -d <device_id>
It fails with an error.
I have ensured the following:
- Java version: 23
- Flutter SDK: Latest
- Android licenses: All accepted
- Gradle version: 8.10
- Kotlin version: 2.1.0
- VS Code & Android Studio: Installed and used for debugging
- Windows 11: Running on this OS
Additionally, the Android emulator crashes when I try to run the app.
What I Have Tried
- Running
flutter doctor
(No issues reported) - Cleaning the project with
flutter clean
- Running
flutter pub get
- Checking Gradle and Android dependencies
- Reinstalling Android Studio and VS Code
I am completely frustrated as I cannot test my app on Android devices. Any help in troubleshooting this issue would be greatly appreciated!
Questions
- How can I resolve the APK build failure?
- Why is my app not running on a physical Android device?
- Are there compatibility issues with Java 23 and my Flutter setup?
This should help you get clear responses on Stack Overflow. Before posting, try running flutter doctor -v
and include its output in your question for better troubleshooting.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745069451a4609456.html
评论列表(0条)