[英]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.
它使用OpenGL ES 2.0和自定义GLSL着色器。 I'm testing in Eclipse on a real device: my Droid Razr M, connected via USB.
我正在Eclipse上的真实设备上进行测试:我的Droid Razr M通过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
但是,在Android上,它立即崩溃,其中只有LogCat信息是唯一线索: 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. 编辑 :在某些运行中,LogCat提到了在编译着色器时的错误。 The shaders still compile fine on the desktop, however.
但是,着色器仍可以在桌面上正常编译。 Shader errors here: https://imageshack.us/a/img835/4554/rrjh.png
此处的着色器错误: 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. 我没有看到您的着色器,但我认为如果从浮点数(0.16f-> 0.16)中删除f后缀,则着色器应该可以编译。
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. 不同的GPU之间存在很多差异,尤其是电话中的gpu(例如adreno 200)和pc中的gpu之间,其中之一似乎是浮点数的后缀f。这就是为什么它可以在pc上编译而没有问题的原因不在android上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.