简体   繁体   English

试图在Android上运行Libgdx应用程序,但崩溃。 桌面版效果很好

[英]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.

相关问题 LIBGDX在桌面上运行良好,但在Android上崩溃 - LIBGDX runs fine on desktop, but crashes on android 使用LibGDX -desktop而不是LibGDX - Android的程序运行良好? - Programs run fine with LibGDX -desktop but not LibGDX - Android? “ Android”中的libGDX黑屏,在“桌面”上正常运行 - libGDX black screen in 'Android', works fine on 'Desktop' 尝试将两个字符替换为一个字符时,应用程序崩溃。 一字符替换效果很好 - When trying to replace two character with one the application crashes. It works fine with one character replacement 从手机运行时,Android App崩溃,但在模拟器中工作正常 - Android App crashes when run from phone but works fine in emulator libgdx和TWL:Android应用程序强制在任何TWL菜单上关闭,在桌面上正常工作 - libgdx and TWL: Android app force closes on any TWL menu, works fine on Desktop LibGDX应用程序可在台式机上运行,​​在Android上为黑屏 - LibGDX app works on Desktop, black screen on Android Android / LibGDX-不能将Integer强制转换为浮点数(但对于桌面系统来说效果很好) - Android/LibGDX - Integer cannot be casted to float (but it works fine for desktop) App CameraSurface的首次启动会崩溃。 提交许可后,它可以工作 - First start of App CameraSurface crashes. After submitting Permission it works Android ListView示例崩溃。 无法启动应用 - Android ListView example crashes. Can't start app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM