google / android-emulator-m1-preview

Apache License 2.0
1.83k stars 161 forks source link

OpenGL incompatibility? #7

Open WDgaster66 opened 3 years ago

WDgaster66 commented 3 years ago

I had the preview successfully launch, installed an app, and even created a custom AVD that flawlessly functioned at 5120x2880 resolution. After conducting a few tests after changing settings in attempts to optimize performance, I changed a setting relating to OpenGL in the emulator itself ( the menu that displays upon clicking the 3 dots at the bottom of the bar on the right ). Now, my mac refuses to boot any AVDs. I cannot change it back, as the menu to change it is only accessible after successfully launching the AVD. Upon attempting to launch an instance, the AVD loads and shows up in the activity monitor, however no window appears. Followed up with a "unresponsive app" notification. I've tried a full reset of Android Studio and cleared all files related to it, however it still remains unresponsive. I might be confused on what caused the issue, although I believe that changing it's rendering options creates an issue.

WDgaster66 commented 3 years ago
Screen Shot 2021-01-12 at 6 34 10 PM

I factory reset my M1 and can confirm that messing with these settings basically bricks your emulators. I don't know where the settings file for this is saved, so you can't really revert this change without clearing everything.

741g commented 3 years ago

Sorry about that; it's a Qt setting and Qt settings are system wide. To fix it next time around, you'll have to dig into the runemu script and add -gpu host to the emulator invocation there.

PontonMao commented 3 years ago

@WDgaster66
I did the same thing. Have you solved it?How?

marcosalis commented 2 years ago

I have the same exact issue and haven't been able to find a workaround so far. Using the latest emulator tools (31.2.8). If I run the emulator from the command line I get these error messages:

ERROR   | EglOsGlLibrary: Could not open GL library libGLESv2.dylib [dlopen(libGLESv2.dylib, 0x0002): tried: '/Users/...' (no such file), '/Users/.../Library/Android/sdk/emulator/lib64/gles_swiftshader/libGLESv2.dylib' (code signature in <B48F2D27-E9C4-30EF-A948]

ERROR   | EglOsEglDispatcher: Could not open EGL library libEGL.dylib [dlopen(libEGL.dylib, 0x0002): tried: '/Users/.../Library/Android/sdk/emulator/lib64/qt/lib/libEGL.dylib' (no such file), '/Users/.../Library/Android/sdk/emulator/lib64/gles_swiftshader/libEGL.dylib' (code signature in <5C3ABCC5-722A-3AEA-AF5B-6CEEFF8D]

Weirdly enough, the emulator runs correctly when launched with sudo from the terminal (but it doesn't work with Studio, I guess due to permissions issues).

moyuwangP commented 2 years ago

adding sudo doesn't work for me. will this issue be fixed?

Tracht commented 2 years ago

Sorry about that; it's a Qt setting and Qt settings are system wide. To fix it next time around, you'll have to dig into the runemu script and add -gpu host to the emulator invocation there.

This worked for me. You're a lifesaver. Full script I used: emulator -avd Pixel_5_API_30 -gpu host inside the path: Users/YourName/Library/Android/sdk/emulator

As specified here: https://developer.android.com/studio/run/emulator-commandline