Flutter Android App Not Generating APK or Running on Physical Device - Stack Overflow

I am new to flutter facing issues while building and running my Flutter app on an Android device. The a

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:

  1. Build an APK:

    flutter build apk
    

    It fails with errors.

  2. 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

  1. How can I resolve the APK build failure?
  2. Why is my app not running on a physical Android device?
  3. 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信