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...
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).
Put this statement right after the beginning of main function.
WidgetsFlutterBinding.ensureInitialized();
And then restart the application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With