"called unimplemented OpenGL ES API" error with Intel APKs in emulator

I have a problem. My phone is too low-qual to even have USB drivers for it, so sending APKs to it is a slow affair.

An Intel HAXM emulator runs OK, but will not load the APKs generated
by HaxeFlixel/FlashDevelop, citing error INSTALL_FAILED_NO_MATCHING_ABIS
because they’re made for ARM. I’d run the ARM emulator, but it’s hella
slow (my laptop is mid-low-range, 4 GB of RAM, Win7.)

Is there a way to generate Intel APKs so that one can test them in an Android emulator at a reasonable speed?

I believe we support x86 support, can try using architecture tags in the XML to try it (this might actually be the default lime test android -emulator behavior)

Oh my, I had searched http://www.openfl.org/documentation/projects/project-files/xml-format/ for ‘intel’ and found nothing. Of course it’s called “X86”…

Thanks for your help :slight_smile:

OK, now it uploads to the emulator successfully.

But as soon as I launch the app within the emulator, it immediately closes (“Unfortunately, myapp has stopped.”) (This doesn’t happen when I generate an ARM apk and post it on Google Play and install it on a real phone–then things worked fine, but that’s a pretty slow cycle to go through for testing.) The emulator is API 21, and my project.xml has:

    <window if="mobile" fullscreen="true" width="0" height="0" />
    <android minimum-sdk-version="19" />
    <android target-sdk-version="21" />
    <android install-location="preferExternal" unless="debug" /><!-- debug mode makes this fail on emu inst: INSTALL_FAILED_CONTAINER_ERROR / No content provider found for permission revoke -->
    <icon path="media-source/icon.svg"/>
    <architecture name="x86" if="android debug" />

The logcat has this to say:

I/ActivityManager( 1223): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.GimmickyApps.myapp/.MainActivity (has extras)} from uid 10007 on display 0
W/AudioTrack( 1223): AUDIO_OUTPUT_FLAG_FAST denied by client
I/ActivityManager( 1223): Start proc com.GimmickyApps.myapp for activity com.GimmickyApps.myapp/.MainActivity: pid=2058 uid=10054 gids={50054, 9997, 3003} abi=x86
I/art     ( 2058): Not late-enabling -Xcheck:jni (already on)
I/OpenAL_SLES( 2058): alc_opensles_init
I/haxe plugin( 2058): Got Load Proc a62fef5b
I/haxe plugin( 2058): Got Load Proc a62fef5b
I/haxe plugin( 2058): Got Load Proc a62fef5b
I/haxe plugin( 2058): Got Load Proc a62fef5b
I/CreateMainFrame!( 2058): creating...
I/Choreographer( 1223): Skipped 33 frames!  The application may be doing too much work on its main thread.
I/Choreographer( 1302): Skipped 34 frames!  The application may be doing too much work on its main thread.
D/gralloc_goldfish( 2058): Emulator without GPU emulation detected.
V/VIEW    ( 2058): onSurfaceCreated
V/VIEW    ( 2058): Thread = 154
V/VIEW    ( 2058): onSurfaceChanged 480,800
V/VIEW    ( 2058): Thread = 154
V/NME     ( 2058): Send on lost
I/ActivityManager( 1223): Displayed com.GimmickyApps.myapp/.MainActivity: +738ms
E/libEGL  ( 2058): called unimplemented OpenGL ES API
E/NME     ( 2058): Unknown error compiling shader :
E/NME     ( 2058): uniform mat4   uTransform;
E/NME     ( 2058): attribute vec4 aVertex;
E/NME     ( 2058): void main()
E/NME     ( 2058): {
E/NME     ( 2058):    gl_Position = aVertex * uTransform;
E/NME     ( 2058): }
E/NME     ( 2058):
E/NME     ( 2058): Unknown error compiling shader :
E/NME     ( 2058): uniform mat4   uTransform;
E/NME     ( 2058): attribute vec4 aVertex;
E/NME     ( 2058): attribute vec4 aColourArray;
E/NME     ( 2058): varying vec4 vColourArray;
E/NME     ( 2058): attribute vec2 aTexCoord;
E/NME     ( 2058): varying vec2 vTexCoord;
E/NME     ( 2058): void main()
E/NME     ( 2058): {
E/NME     ( 2058):    vTexCoord = aTexCoord;
E/NME     ( 2058):    vColourArray = aColourArray;
E/NME     ( 2058):    gl_Position = aVertex * uTransform;
E/NME     ( 2058): }
E/NME     ( 2058):
--------- beginning of crash
F/libc    ( 2058): Fatal signal 6 (SIGABRT), code -6 in tid 2075 (GLThread 154)
I/DEBUG   (  930): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  930): Build fingerprint: 'generic_x86/sdk_phone_x86/generic_x86:5.0.2/LSY64/1772600:eng/test-keys'
I/DEBUG   (  930): Revision: '0'
I/DEBUG   (  930): ABI: 'x86'
I/DEBUG   (  930): pid: 2058, tid: 2075, name: GLThread 154  >>> com.GimmickyApps.myapp <<<
I/DEBUG   (  930): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/BootReceiver( 1223): Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
E/SharedPreferencesImpl( 1223): Couldn't create directory for SharedPreferences file shared_prefs/log_files.xml
W/ActivityManager( 1223):   Force finishing activity com.GimmickyApps.myapp/.MainActivity
I/        ( 2078): debuggerd: Nov 12 2014 00:32:38
D/gralloc (  922): Registering a buffer in the process that created it. This may cause memory ordering problems.
E/libEGL  (  922): called unimplemented OpenGL ES API
E/SurfaceFlinger(  922): glCheckFramebufferStatusOES error -887566170
E/SurfaceFlinger(  922): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
W/WindowManager( 1223): Screenshot failure taking screenshot for (480x800) to layer 21025
E/ActivityManager( 1223): Invalid thumbnail dimensions: 192x192
I/Choreographer( 1223): Skipped 30 frames!  The application may be doing too much work on its main thread.
W/ActivityManager( 1223): Activity pause timeout for ActivityRecord{17fd3eef u0 com.GimmickyApps.myapp/.MainActivity t7 f}
I/ActivityManager( 1223): Killing 1629:com.android.keychain/1000 (adj 15): empty for 2106s
W/libprocessgroup( 1223): failed to open /acct/uid_1000/pid_1629/cgroup.procs: No such file or directory
W/ActivityManager( 1223): Activity destroy timeout for ActivityRecord{17fd3eef u0 com.GimmickyApps.myapp/.MainActivity t7 f}
V/BackupManagerService( 1223): Running a backup pass
V/BackupManagerService( 1223): clearing pending backups
I/LatinIME:LogUtils( 1332): Dictionary info: dictionary = UserHistoryDictionary.en_US ; version = 1453151404 ; date = 1453462542
V/PerformBackupTask( 1223): Beginning backup of 7 targets
D/PerformBackupTask( 1223): invokeAgentForBackup on @[email protected]
V/BackupServiceBinder( 1223): doBackup() invoked
E/PMBA    ( 1223): No global metadata in state file!
I/PMBA    ( 1223): Previous metadata null mismatch vs 1772600 - rewriting
I/BackupRestoreController( 1223): Getting widget state for user: 0
D/PerformBackupTask( 1223): starting agent for backup of BackupRequest{pkg=com.android.dialer}
I/art     (  936): Background concurrent mark sweep GC freed 786(33KB) AllocSpace objects, 0(0B) LOS objects, 90% free, 111KB/1135KB, paused 6.471ms total 39.425ms
I/ActivityManager( 1223): Start proc com.android.dialer for backup com.android.dialer/.DialerBackupAgent: pid=2081 uid=10004 gids={50004, 9997, 3003, 1028, 1015} abi=x86
D/BackupManagerService( 1223): awaiting agent for ApplicationInfo{364d6b78 com.android.dialer}
D/ExtensionsFactory( 2081): No custom extensions.
D/BackupManagerService( 1223): agentConnected pkg=com.android.dialer [email protected]
I/BackupManagerService( 1223): got agent [email protected]
D/PerformBackupTask( 1223): invokeAgentForBackup on com.android.dialer
V/BackupServiceBinder( 2081): doBackup() invoked
D/BackupHelperDispatcher( 2081): handling existing helper 'shared_pref' [email protected]
I/BackupRestoreController( 1223): Getting widget state for user: 0
D/PerformBackupTask( 1223): starting agent for backup of BackupRequest{pkg=com.android.calendar}
I/art     (  936): Background concurrent mark sweep GC freed 777(32KB) AllocSpace objects, 0(0B) LOS objects, 90% free, 110KB/1134KB, paused 6.480ms total 38.261ms
I/ActivityManager( 1223): Start proc com.android.calendar for backup com.android.calendar/.CalendarBackupAgent: pid=2098 uid=10017 gids={50017, 9997, 3003} abi=x86
D/BackupManagerService( 1223): awaiting agent for ApplicationInfo{204543b7 com.android.calendar}
I/ActivityManager( 1223): Killing 1979:com.android.documentsui/u0a24 (adj 15): empty for 2141s
W/libprocessgroup( 1223): failed to open /acct/uid_10024/pid_1979/cgroup.procs: No such file or directory
D/ExtensionsFactory( 2098): No custom extensions.
D/BackupManagerService( 1223): agentConnected pkg=com.android.calendar [email protected]
I/BackupManagerService( 1223): got agent [email protected]
D/PerformBackupTask( 1223): invokeAgentForBackup on com.android.calendar
V/BackupServiceBinder( 2098): doBackup() invoked
D/BackupHelperDispatcher( 2098): handling existing helper 'shared_pref' [email protected]
I/BackupRestoreController( 1223): Getting widget state for user: 0
D/PerformBackupTask( 1223): starting agent for backup of BackupRequest{pkg=com.android.providers.userdictionary}
D/BackupManagerService( 1223): awaiting agent for ApplicationInfo{26126c42 com.android.providers.userdictionary}
D/BackupManagerService( 1223): agentConnected pkg=com.android.providers.userdictionary [email protected]
I/BackupManagerService( 1223): got agent [email protected]
D/PerformBackupTask( 1223): invokeAgentForBackup on com.android.providers.userdictionary
V/BackupServiceBinder( 1511): doBackup() invoked

Why should it have “called unimplemented OpenGL ES API” here, given the API versions I’m using in the emulator and targeting in the project.xml?

Similar/same output if I use 21 as the minimum API in project.xml:

I/ActivityManager( 1223): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.GimmickyApps.myapp/.MainActivity (has extras)} from uid 10007 on display 0
I/Choreographer( 1447): Skipped 64 frames!  The application may be doing too much work on its main thread.
I/ActivityManager( 1223): Start proc com.GimmickyApps.myapp for activity com.GimmickyApps.myapp/.MainActivity: pid=2298 uid=10055 gids={50055, 9997, 3003} abi=x86
I/art     ( 2298): Not late-enabling -Xcheck:jni (already on)
I/OpenAL_SLES( 2298): alc_opensles_init
I/haxe plugin( 2298): Got Load Proc a6570f5b
I/haxe plugin( 2298): Got Load Proc a6570f5b
I/haxe plugin( 2298): Got Load Proc a6570f5b
I/haxe plugin( 2298): Got Load Proc a6570f5b
I/CreateMainFrame!( 2298): creating...
D/gralloc_goldfish( 2298): Emulator without GPU emulation detected.
V/VIEW    ( 2298): onSurfaceCreated
V/VIEW    ( 2298): Thread = 203
V/VIEW    ( 2298): onSurfaceChanged 480,800
V/VIEW    ( 2298): Thread = 203
V/NME     ( 2298): Send on lost
E/libEGL  ( 2298): called unimplemented OpenGL ES API
E/NME     ( 2298): Unknown error compiling shader :
E/NME     ( 2298): uniform mat4   uTransform;
E/NME     ( 2298): attribute vec4 aVertex;
E/NME     ( 2298): void main()
E/NME     ( 2298): {
E/NME     ( 2298):    gl_Position = aVertex * uTransform;
E/NME     ( 2298): }
E/NME     ( 2298):
E/NME     ( 2298): Unknown error compiling shader :
E/NME     ( 2298): uniform mat4   uTransform;
E/NME     ( 2298): attribute vec4 aVertex;
E/NME     ( 2298): attribute vec4 aColourArray;
E/NME     ( 2298): varying vec4 vColourArray;
E/NME     ( 2298): attribute vec2 aTexCoord;
E/NME     ( 2298): varying vec2 vTexCoord;
E/NME     ( 2298): void main()
E/NME     ( 2298): {
E/NME     ( 2298):    vTexCoord = aTexCoord;
E/NME     ( 2298):    vColourArray = aColourArray;
E/NME     ( 2298):    gl_Position = aVertex * uTransform;
E/NME     ( 2298): }
E/NME     ( 2298):
I/Choreographer( 2298): Skipped 134 frames!  The application may be doing too much work on its main thread.
I/ActivityManager( 1223): Displayed com.GimmickyApps.myapp/.MainActivity: +1s249ms
F/libc    ( 2298): Fatal signal 6 (SIGABRT), code -6 in tid 2314 (GLThread 203)
I/DEBUG   ( 2078): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 2078): Build fingerprint: 'generic_x86/sdk_phone_x86/generic_x86:5.0.2/LSY64/1772600:eng/test-keys'
I/DEBUG   ( 2078): Revision: '0'
I/DEBUG   ( 2078): ABI: 'x86'
I/DEBUG   ( 2078): pid: 2298, tid: 2314, name: GLThread 203  >>> com.GimmickyApps.myapp <<<
I/DEBUG   ( 2078): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/BootReceiver( 1223): Copying /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)
E/SharedPreferencesImpl( 1223): Couldn't create directory for SharedPreferences file shared_prefs/log_files.xml
I/        ( 2317): debuggerd: Nov 12 2014 00:32:38
W/ActivityManager( 1223):   Force finishing activity com.GimmickyApps.myapp/.MainActivity
D/gralloc (  922): Registering a buffer in the process that created it. This may cause memory ordering problems.
E/libEGL  (  922): called unimplemented OpenGL ES API
E/SurfaceFlinger(  922): glCheckFramebufferStatusOES error -887566170
E/SurfaceFlinger(  922): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
W/WindowManager( 1223): Screenshot failure taking screenshot for (480x800) to layer 21025
E/ActivityManager( 1223): Invalid thumbnail dimensions: 192x192
W/ActivityManager( 1223): Activity pause timeout for ActivityRecord{3802c9e0 u0 com.GimmickyApps.myapp/.MainActivity t9 f}
I/Choreographer( 1223): Skipped 31 frames!  The application may be doing too much work on its main thread.
W/AudioTrack( 1223): AUDIO_OUTPUT_FLAG_FAST denied by client
W/ActivityManager( 1223): Activity destroy timeout for ActivityRecord{3802c9e0 u0 com.GimmickyApps.myapp/.MainActivity t9 f}
I/UsageStatsService( 1223): User[0] Flushing usage stats to disk

This line looks bad:

Emulator without GPU emulation detected

This sounds like it’s not supporting OpenGL ES in the emulator?

Is that the same thing as the “use host GPU” option of the emulator? I believe I had tried that (since it’s supported by API 16+ or something like that, IIRC, and although I initially wanted to target lower, I was trying higher APIs to see if my problems went away) and could not boot the emulator. But let me try again.

Well, it boots with “use host GPU.” Trying an APK…OK, this wasn’t the one I was trying before (I thought I’d take a simpler example ( https://github.com/GimmickyApps/HaxeFlixelDevRepros/tree/ab14ee018e123f1788b67815b57c94eba8104826 ); it has minimum API 15–21 gives the same–and target 21), but now the app gives a blank screen without a crash, and see the output of my trace() calls too. The output was:

I/ActivityManager( 1234): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.myapp/.MainActivity (has extras)} from uid 10007 on display 0
V/NME     ( 1978): Activity action 1
E/OpenAL_SLES( 1978): openal resume
W/libc    ( 1978): pthread_create sched_setscheduler call failed: Operation not permitted
I/trace   ( 1978): PlayState.hx:56: 480,800
E/libEGL  ( 1978): call to OpenGL ES API with no current context (logged once per thread)
I/OpenAL_SLES( 1978): playback_function started
V/VIEW    ( 1978): onSurfaceChanged 480,800
V/VIEW    ( 1978): Thread = 138
I/trace   ( 1978): PlayState.hx:56: 480,800
W/EGL_emulation( 1978): eglSurfaceAttrib not implemented
W/OpenGLRenderer( 1978): Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5d4a860, error=EGL_SUCCESS
V/VIEW    ( 1978): onSurfaceChanged 480,800
V/VIEW    ( 1978): Thread = 138
I/trace   ( 1978): PlayState.hx:56: 480,800

I guess the blankness has something to do with one of the EGL lines…

OK, the original API 21 APK, running on an emulator with “use host GPU”: same user result (crash), different logcat:

I/OpenAL_SLES( 2032): alc_opensles_init
I/haxe plugin( 2032): Got Load Proc a659b1a3
I/haxe plugin( 2032): Got Load Proc a659b1a3
I/haxe plugin( 2032): Got Load Proc a659b1a3
I/haxe plugin( 2032): Got Load Proc a659b1a3
I/CreateMainFrame!( 2032): creating...
D/        ( 2032): HostConnection::get() New Host Connection established 0xae3e90d0, tid 2032
D/OpenGLRenderer( 2032): Render dirty regions requested: true
D/Atlas   ( 2032): Validating map...
I/OpenGLRenderer( 2032): Initialized EGL, version 1.4
D/        ( 2032): HostConnection::get() New Host Connection established 0xae3e9b30, tid 2049
D/OpenGLRenderer( 2032): Enabling debug mode 0
W/EGL_emulation( 2032): eglSurfaceAttrib not implemented
W/OpenGLRenderer( 2032): Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5068060, error=EGL_SUCCESS
D/        ( 2032): HostConnection::get() New Host Connection established 0xa5065130, tid 2048
V/VIEW    ( 2032): onSurfaceCreated
V/VIEW    ( 2032): Thread = 143
V/VIEW    ( 2032): onSurfaceChanged 480,800
V/VIEW    ( 2032): Thread = 143
V/NME     ( 2032): Send on lost
I/ActivityManager( 1234): Displayed com.GimmickyApps.myapp/.MainActivity: +810ms
--------- beginning of crash
F/libc    ( 2032): Fatal signal 6 (SIGABRT), code -6 in tid 2048 (GLThread 143)
I/DEBUG   (  943): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  943): Build fingerprint: 'generic_x86/sdk_phone_x86/generic_x86:5.0.2/LSY64/1772600:eng/test-keys'
I/DEBUG   (  943): Revision: '0'
I/DEBUG   (  943): ABI: 'x86'
I/DEBUG   (  943): pid: 2032, tid: 2048, name: GLThread 143  >>> com.GimmickyApps.myapp <<<
I/DEBUG   (  943): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/        ( 2052): debuggerd: Nov 12 2014 00:32:38
I/BootReceiver( 1234): Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
E/SharedPreferencesImpl( 1234): Couldn't create directory for SharedPreferences file shared_prefs/log_files.xml
W/ActivityManager( 1234):   Force finishing activity com.GimmickyApps.myapp/.MainActivity
D/        ( 1234): HostConnection::get() New Host Connection established 0xa6053670, tid 2053
E/EGL_emulation(  933): tid 933: eglCreateSyncKHR(1237): error 0x3004 (EGL_BAD_ATTRIBUTE)
D/OpenGLRenderer( 1234): Render dirty regions requested: true
D/Atlas   ( 1234): Validating map...
D/        ( 1234): HostConnection::get() New Host Connection established 0xa5435540, tid 2055
I/OpenGLRenderer( 1234): Initialized EGL, version 1.4
D/OpenGLRenderer( 1234): Enabling debug mode 0
W/EGL_emulation( 1234): eglSurfaceAttrib not implemented
W/OpenGLRenderer( 1234): Failed to set EGL_SWAP_BEHAVIOR on surface 0x9fe017c0, error=EGL_SUCCESS
W/ActivityManager( 1234): Activity pause timeout for ActivityRecord{8b29393 u0 com.GimmickyApps.myapp/.MainActivity t8 f}
W/EGL_emulation( 1461): eglSurfaceAttrib not implemented
W/OpenGLRenderer( 1461): Failed to set EGL_SWAP_BEHAVIOR on surface 0xa4f4ff40, error=EGL_SUCCESS
I/ActivityManager( 1234): Killing 1819:com.android.mms/u0a9 (adj 15): empty for 2077s
D/CountryDetector( 1234): No listener is left
W/libprocessgroup( 1234): failed to open /acct/uid_10009/pid_1819/cgroup.procs: No such file or directory
W/ActivityManager( 1234): Activity destroy timeout for ActivityRecord{8b29393 u0 com.GimmickyApps.myapp/.MainActivity t8 f}
W/OpenGLRenderer( 1461): Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...