skip to Main Content

My Flutter app functions correctly on API level 30 or lower and on real devices with higher API levels. However, when I run it on an emulator with an API level above 30, it fails during installation with the error message: "Error connecting to the service protocol: failed to connect to http://127.0.0.1:51427/xFHsz1qdYHY=/ the Dart compiler exited unexpectedly." I have tried uninstalling the app, wiping the emulator data, and cold rebooting the emulator, but the issue persists. Any insights on resolving this would be appreciated.

Tried reinstalling app, expected successful installation.
After running flutter run –verbose
enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    Add the following two lines to the android/app/build.gradle file:

    implementation 'androidx.window:window:1.0.0'  
    implementation 'androidx.window:window-java:1.0.0'
    

  2. Can you mention the compilesdk, targetsdk, minsdk version in the app-level build.gradle file.

    make the targetsdkversion to 34(latest) .

    please mention if it doesn’t work. Also post some screenshots of build.gradle file.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search