12

I am trying to start Windows app for first time with default Flutter Project but it's showing this error espacialy.

Unable to start engine without AOT data.
Failed to create view controller.
Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
Error launching application on Windows.
Exited (sigterm)

Here is my flutter doctor -v results:

[√] Flutter (Channel stable, 2.10.0, on Microsoft Windows [Version
    10.0.19042.1526], locale tr-TR)
    • Flutter version 2.10.0 at D:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5f105a6ca7 (2 weeks ago), 2022-02-01 14:15:42 -0800
    • Engine revision 776efd2034
    • Dart version 2.16.0
    • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version    
    31.0.0)
    • Android SDK at D:\sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = C:\Users\pc\AppData\Local\Android\Sdk
    • Java binary at: D:\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at
    .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.0)  
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community 
    • Visual Studio Community 2022 version 17.1.32210.238
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2020.3)
    • Android Studio at D:\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)   

[√] Connected device (2 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API  
      30) (emulator)
    • Windows (desktop)       • windows       • windows-x64 • Microsoft Windows      [Version 10.0.19042.1526]

[√] HTTP Host Availability

I tried flutter clean but it is not working. What can I do for this error?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Tolga Yılmaz
  • 506
  • 1
  • 3
  • 15

10 Answers10

11

I have fixed this issue from aceta-minophen on github (https://github.com/flutter/flutter/issues/97086#issuecomment-1029963716)

aceta-minophen solution:

Found the app.so file in ..\build\windows

Copied the file and pasted it in ..\build\windows\runner\Debug\data

[UPDATE]

upgrading flutter to the last version should fix this:

RUN:

flutter upgrade

  • 1
    As already mentioned in this Github thread, it is not a fix, but a workaround. VS developers are [aware](https://github.com/flutter/flutter/issues/97086#issuecomment-1043655726) of this issue – Aray Karjauv Feb 18 '22 at 18:19
  • 2
    Thanks. This workaround is much quicker and easier than uninstalling VS22 and installing VS19. – Chris Swan Feb 19 '22 at 11:42
  • 1
    This isn't really a workaround for not being able to run a debug build, because what you will end up with by doing this is a (mostly) release build. – smorgan Feb 21 '22 at 19:25
  • 1
    It worked for me; I have both VS2022 and VS2019 installed; Windows App only blinked and died before this workaround. – Marcelo Scofano Diniz Mar 02 '22 at 01:26
5

It seems that problem with this version of Visual Studio

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.0)  
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community 
    • Visual Studio Community 2022 version 17.1.32210.238
    • Windows 10 SDK version 10.0.22000.0

Try to unintall Visual Studio Community 2022 and install Visual Studio Community 2019

With Visual Studio 2019 all works like a charm :)

Alex Zhulin
  • 1,239
  • 2
  • 22
  • 42
  • 1
    I just went through the same hell. I have just realised this, its hard work to get a simple hello world to run . for anyone facing this issue trust me you have to uninstall the visual studio 22 to version 19. – kinsley kajiva Feb 16 '22 at 22:58
  • 1
    I too have VS2022 and VS2019 installed; Windows App only blink and died with the _unable to set AOT..._ message. After I copied App.so to _..\build\windows\runner\Debug\data_ it showed without need even a reload of VS Code... – Marcelo Scofano Diniz Mar 02 '22 at 01:25
1

I was getting some AOT error wile launching the windows app from vs code , so i downgraded visual studio 2022 to visual studio 2019 and it was working for me

1

A workaround that also allowed debugging:

edit <proj_dir>\windows\flutter\CMakeLists.txt to replace $<CONFIG> with Debug

There was a single occurrence, near the end of add_custom_command. This was needed after upgrading VS 2022 to 17.1.0 (it worked fine with 17.0.6). Windows support for the project was initially added with flutter create --platforms=windows .

VS bug: CMake->vcxproj regression in 17.1.0 when using $ in custom command.

catalin
  • 1,927
  • 20
  • 20
1

Flutter 2.10.3 resolves this issue.

0

I stated a fix for the issue on the video here it was simply the app.so being in the wrong folder, You can watch the video here with full details

  • 2
    What's the fix? Links to content that one day may vanish is a bad idea. Can you tell us what's in the video? – Kenny Mann Feb 26 '22 at 21:03
0

Steps to Reproduce

        Create a new application.
        run flutter run -d windows --debug

    Expected results: The build should success.
    Actual results: Can't load AOT data from C:\Users\nieti\Desktop\flutter_application_1\build\windows\runner\Debug\data\app.so; no such file. Unable to start engine without AOT data. Failed to create view controller. Error waiting for a debug connection: The log reader stopped unexpectedly, or never started. Error launching application on Windows.
    Logs

Did you manage to solve your issue? Im facing this exact issue but flutter doctor shows that everything is OK and Windows is listed on Connected Devices. Im on Flutter 2.10

Hey! I faced the same issue today and I solved this by doing the following:

Found the app.so file in ..\build\windows
Copied the file and pasted it in ..\build\windows\runner\Debug\data
0

This is a good workaround: https://stackoverflow.com/a/71216391/9948598

I need to restore CMakeLists.txt to his original state before build for release, but the modified version let me work in debug mode.

0

In my case app.so file was not in build/windows either.

Solution is to find any app.so file and copy to ..\build\windows\runner\Debug\data

In vs code use Go -> Go to File...

Yuriy N.
  • 4,936
  • 2
  • 38
  • 31
-1

I have another solution instead of uninstalling visual Studio 2022 version just modify the the settings inside installer and install the latest version of windows sdk i.e. win sdk 10(10.0.20348.0) and that will solve the problem of app.so hence the AOTdata not found problem

Devrohit
  • 7
  • 2
  • don't just always thing to downgrade to 2019 VS because with VS 22 flutter architecture works better. Just need to modify the version accordingly – Devrohit Feb 17 '22 at 07:57
  • 1
    I did downgrade to 10.0.20348.0 but still getting the same error with VS22. Even with 10.0.18362.0 it is the same. Is there anything else that has to be done? – AshishB Feb 18 '22 at 09:00
  • Downgrading to Visual Studio 2022 17.0.6 should work. It is a bug in only the latest update, 17.1.0. Hopefully they will fix it soon. – Jogy Feb 20 '22 at 18:30