当我运行我的 AndEngine 程序时,我的手机出现这样的错误 它在我的 frnds 手机上成功运行,但是当我尝试运行时,出现错误,例如检测到固有不兼容的设备...
我的logcat在下面
10-16 14:13:23.061: E/AndroidRuntime(4533): FATAL EXCEPTION: GLThread 10
10-16 14:13:23.061: E/AndroidRuntime(4533): java.lang.ExceptionInInitializerError
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.opengl.vbo.attribute.VertexBufferObjectAttributeFix.glVertexAttribPointer(VertexBufferObjectAttributeFix.java:39)
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.opengl.vbo.attribute.VertexBufferObjectAttributes.glVertexAttribPointers(VertexBufferObjectAttributes.java:50)
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.opengl.shader.ShaderProgram.bind(ShaderProgram.java:126)
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.opengl.shader.PositionTextureCoordinatesShaderProgram.bind(PositionTextureCoordinatesShaderProgram.java:86)
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.opengl.vbo.VertexBufferObject.bind(VertexBufferObject.java:162)
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.opengl.texture.TextureWarmUpVertexBufferObject.warmup(TextureWarmUpVertexBufferObject.java:97)
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.opengl.texture.TextureManager.updateTextures(TextureManager.java:257)
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.engine.Engine.onDrawFrame(Engine.java:613)
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.opengl.view.EngineRenderer.onDrawFrame(EngineRenderer.java:105)
10-16 14:13:23.061: E/AndroidRuntime(4533): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1332)
10-16 14:13:23.061: E/AndroidRuntime(4533): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
10-16 14:13:23.061: E/AndroidRuntime(4533): Caused by: org.andengine.util.exception.AndEngineRuntimeException: Inherently incompatible device detected.
10-16 14:13:23.061: E/AndroidRuntime(4533): at org.andengine.opengl.GLES20Fix.<clinit>(GLES20Fix.java:39)
最佳答案
Luckily it is very easy to fix - in your sources root (the directory where AndroidManifest.xml is) make a directory named libs inside which then make a directory named armeabi. Now get AndEnginesources (from an OpenGL ES 2.0 branch) - from here. You can clone the repository or download it. Doesn’t matter.
What matters is that you should copy the libandengine.so available there in libs/armeabi to the libs/armeabi you have just created in your directory. Will fix the issue :)
Probably this is not the official solution, maybe we haven’t seen a note somewhere on AndEngine’s forums, but this method fixes the problem in 30 seconds and doesn’t produce any other issues.
And - Why did it crash? What does it fix?
It’s quite funny actually. Google developers, when preparing the Froyo Java SDK, forgot to implement Java versions of some of (standard!) OpenGL ES 2.0 functions. The solution to this problem is to use JNI to create a call bridge to a native function that is missing in the SDK. AndEngine has this bridge in the mentioned libandengine.so. When the engine is launched it checks the version of OS. If it is Froyo (or lower) it tries to load the library. If the library is not present it has no way of solving this and has to crash.
关于android - 和 EngineRuntimeException : Inherently incompatible device detected.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12910953/