When I ran my flutter app on an android emulator for the first time it ran smoothly. However, after the first launch, it shows an error.
Here is the error:
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
I/ample.food_fete( 6664): Compiler allocated 4533KB to compile void android.view.ViewRootImpl.performTraversals()
Connecting to VM Service at ws://127.0.0.1:41429/ZIJH4M0Maio=/ws
9
E/emuglGLESv2_enc( 6664): device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGetUniformLocation:2183 GL error 0x502
W/Parcel ( 6664): Expecting binder but got null!
I have tried to uninstall android studio updating things to the latest but this problem persists. Is there anyone who can help me?
2
Answers
For now, I have found a way. After first run everytime it shows this error. Now before starting the app I go into that app info and delete the cache then it runs fine without any oepengl error. And with running on hardware mode my emulator runs good. But still sometimes emulator does not open correctly then close and open it again works. I do not what is the main problem. But I think it is also related to that error which shows
flutter doctor --android-licenses ✔ Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. Warning: Errors during XML parse: Warning: Additionally, the fallback loader failed to parse the XML. [=======================================] 100% Computing updates... All SDK package licenses accepted.
So here as it was not able to comprehend those XML files maybe it also could be because of that opengl is not able to respond well.Steps to reproduce
error:
E/emuglGLESv2_enc( 5842): device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGetUniformLocation:2206 GL error 0x502
I think the error may be related to acceleration for the Android Emulator: Configure hardware acceleration for the Android Emulator