简体   繁体   中英

Trying to run Libgdx app on Android, but it crashes. Desktop version works fine

My game is a relatively basic game at this point. It uses OpenGL ES 2.0, with custom GLSL shaders. I'm testing in Eclipse on a real device: my Droid Razr M, connected via USB.

The game runs fine on desktop. Howevever, on Android, it immediately crashes, with this LogCat information being the only clue: http://i.imgur.com/MgWzJQO.png

I've spent the last hour or two googling the errors within, but none of the results have helped.

edit : On some runs, LogCat mentions errors in compiling the shaders. The shaders still compile fine on the desktop, however. Shader errors here: https://imageshack.us/a/img835/4554/rrjh.png

I don't have seen you shaders but i think if you remove the f suffix from the float numbers(0.16f -> 0.16) the shaders should compile with no problem.

There are many differences beetween different gpu's and especially between the ones in phones(like the adreno 200) and the ones in pc's ,one of them seems to bee the f suffix on the float numbers .Thats why it compiles with no problem on pc but not on android.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM