這兩天將之前提到的一個室內定位程序的ArcGIS的SDK從10.2.8遷移到100.1.0.
期間反復出現奇怪的問題,最終定位到這個問題:
java.lang.RuntimeException: createContext failed: EGL_BAD_CONFIG at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1233) at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1224) at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1074) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1447) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1286)
看起來是OpenGL,花了我一整天的時間也沒搞定。
最后看到GeoNet上有人問了一個問題,他的問題描述為:
06-14 11:12:11.699 8073-8101/? E/AndroidRuntime: FATAL EXCEPTION: GLThread 332 java.lang.RuntimeException: createContext failed: EGL_SUCCESS at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1197) at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1188) at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1038) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1405) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1244)06-14 11:12:18.039 8136-8167/? E/fb4a(:<default>):MmsConfig: MmsConfig.loadMmsSettings mms_config.xml missing uaProfUrl setting
雖然問題不同(EGL_SUCCESS,EGL_BAD_CONFIG),看到了官方回復:
This is a known issue for this release that has not found its way into the release notes yet, we will update the release notes soon.
The issue is that some devices do not correctly report their OpenGL configurations to allow us to create our OpenGL context. We need to be specific in creating the OpenGL context to allow many of our map rendering features to work properly (particularly for things like Vector Tiled Layers). We have implemented a solution which works on most devices, but it will still be problematic on some, especially older devices running older versions of Android.
大意是說,他們這個版本的API還有問題,因為部分設備不報告OpenGL的配置信息給他們使用導致的問題,他們會很快修復。
所以我趕緊換了台設備測試,這下正常了。
然而。。。。一年過去了,他們還沒更新API解決這個問題!!!
所以需要穩定可靠的童鞋還是用10.2.8的老版本吧,雖然他們不會再支持了。