Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter's main.dart file gets stuck at "Syncing files to device Android SDK built for x86 64..." at execution in Android Studio

I am trying out my first ever flutter code on Android Studio and I am displaying it on an emulator. I do get the output but the compilation never ends, which means I cannot Hot Restart my code. The tutorial I am learning from isn't getting this problem.

EDIT : Some new errors arose. It started hanging at "Installing build\app\outputs\apk\app.apk", I solved that issue and now it displays this. It is intermittent, the skipped frame and lines interchange but more or less the problem remains the same. Please help am going crazy over solving it :)

The following code appears:

Launching lib\main.dart on Android SDK built for x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
Syncing files to device Android SDK built for x86 64...
I/Choreographer( 5985): Skipped 61 frames!  The application may be doing too much work on its main thread.
D/EGL_emulation( 5985): eglMakeCurrent: 0x7e7ece03e300: ver 3 0 (tinfo 0x7e7ece1a85e0)
I/OpenGLRenderer( 5985): Davey! duration=1554ms; Flags=1, IntendedVsync=1503595359014, Vsync=1504612025640, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1504619561700, AnimationStart=1504619633200, PerformTraversalsStart=1504619653300, DrawStart=1504626010200, SyncQueued=1504626824700, SyncStart=1504630541800, IssueDrawCommandsStart=1504630721200, SwapBuffers=1504690106800, FrameCompleted=1505153649500, DequeueBufferDuration=49170000, QueueBufferDuration=2336000, 
D/EGL_emulation( 5985): eglMakeCurrent: 0x7e7ecc6fa7e0: ver 3 0 (tinfo 0x7e7ecc62baa0)
Syncing files to device Android SDK built for x86 64...
like image 431
Sid Sabhlok Avatar asked Jan 28 '20 19:01

Sid Sabhlok


2 Answers

Well, it seems on Linux that's because of some changes in kernel 5.5. I tested multiple times and I am sure - on kernel 5.4 it works, but on kernel 5.5 refactoring hangs and also debug does not work.

That's strange, I have no idea how is is related to kernel (refactoring? wtf?), I can suspect some changes in filsestem handling could cause that? Need to create bug report to InteliJ or Flutter and tell them new kernel causes problem.

Also strange, when developing in Java/Kotlin with Android Studio, I have no problems, refactoring and debug both work just fine. So this must be related to Flutter.

So, on Linux need to downgrade kernel to 5.4 for now (no idea about Mac or Win).

like image 144
user1209216 Avatar answered Sep 28 '22 17:09

user1209216


Put this statement right after the beginning of main function.

WidgetsFlutterBinding.ensureInitialized();

And then restart the application.

like image 23
Bilal Saeed Avatar answered Sep 28 '22 19:09

Bilal Saeed