3

我有一个基于 OpenGL 的应用程序,当我从 eclipse 编译和构建并将其安装在我的 android 设备上时,它运行良好,但是,当我尝试发布相同的应用程序并通过 Google-Play 安装时,应用程序似乎崩溃了,没有给出一个 ANR 对话。我什至尝试从 USB 安装我签名的 .apk 并且一切正常。但是已发布的 Google-Play 版本不起作用。

有什么方法可以在已发布的 Google-play 版本上添加一些调试输出?

我没有看到任何强制关闭或任何东西,它只是退出,然后是日志。它似乎在我的本机 c++ 函数中崩溃:

06-20 12:27:36.859: D/SensorManager(14842): ====>>>>>Num Sensor: 1
06-20 12:27:36.859: D/SensorManager(14842): ====>>>>>Num Sensor: 2
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 3
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 4
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 5
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 6
06-20 12:27:36.869: D/SensorManager(14842): ====>>>>>Num Sensor: 0
06-20 12:27:36.889: I/GLThread(14842): noticed surfaceView surface lost tid=11
06-20 12:27:36.969: I/GLThread(14842): noticed surfaceView surface acquired tid=11
06-20 12:27:36.969: W/EglHelper(14842): start() tid=11
06-20 12:27:38.019: W/dalvikvm(14842): threadid=6: spin on suspend #1 threadid=9 (pcf=0)
06-20 12:27:38.769: W/dalvikvm(14842): threadid=6: spin on suspend #2 threadid=9 (pcf=0)
06-20 12:27:38.769: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:38.769: I/dalvikvm(14842):   | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:38.769: I/dalvikvm(14842):   | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:38.769: I/dalvikvm(14842):   at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:38.769: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:38.769: I/dalvikvm(14842):   | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:38.769: I/dalvikvm(14842):   | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:38.779: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:38.779: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:38.779: I/dalvikvm(14842):   at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:38.779: I/dalvikvm(14842):   at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:39.529: W/dalvikvm(14842): threadid=6: spin on suspend #3 threadid=9 (pcf=0)
06-20 12:27:39.529: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:39.529: I/dalvikvm(14842):   | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:39.529: I/dalvikvm(14842):   | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:39.529: I/dalvikvm(14842):   at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:39.529: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:39.529: I/dalvikvm(14842):   | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:39.529: I/dalvikvm(14842):   | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:39.539: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:39.539: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:39.539: I/dalvikvm(14842):   at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:39.539: I/dalvikvm(14842):   at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:40.299: W/dalvikvm(14842): threadid=6: spin on suspend #4 threadid=9 (pcf=0)
06-20 12:27:40.299: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:40.299: I/dalvikvm(14842):   | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:40.299: I/dalvikvm(14842):   | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:40.299: I/dalvikvm(14842):   at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:40.299: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:40.299: I/dalvikvm(14842):   | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:40.299: I/dalvikvm(14842):   | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:40.519: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:40.519: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:40.519: I/dalvikvm(14842):   at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:40.519: I/dalvikvm(14842):   at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:41.269: W/dalvikvm(14842): threadid=6: spin on suspend #5 threadid=9 (pcf=0)
06-20 12:27:41.269: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:41.269: I/dalvikvm(14842):   | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:41.269: I/dalvikvm(14842):   | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:41.269: I/dalvikvm(14842):   at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:41.269: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:41.269: I/dalvikvm(14842):   | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:41.269: I/dalvikvm(14842):   | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:42.319: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:42.319: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:42.319: I/dalvikvm(14842):   at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:42.319: I/dalvikvm(14842):   at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:43.069: W/dalvikvm(14842): threadid=6: spin on suspend #6 threadid=9 (pcf=0)
06-20 12:27:43.069: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:43.069: I/dalvikvm(14842):   | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:43.069: I/dalvikvm(14842):   | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:43.069: I/dalvikvm(14842):   at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:43.069: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:43.069: I/dalvikvm(14842):   | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:43.069: I/dalvikvm(14842):   | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:43.139: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:43.139: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:43.139: I/dalvikvm(14842):   at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:43.139: I/dalvikvm(14842):   at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:43.899: W/dalvikvm(14842): threadid=6: spin on suspend #7 threadid=9 (pcf=0)
06-20 12:27:43.899: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:43.899: I/dalvikvm(14842):   | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:43.899: I/dalvikvm(14842):   | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:43.899: I/dalvikvm(14842):   at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:43.899: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:43.899: I/dalvikvm(14842):   | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:43.899: I/dalvikvm(14842):   | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:43.899: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:43.899: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:43.899: I/dalvikvm(14842):   at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:43.899: I/dalvikvm(14842):   at surreal.quake3.engine.c.run((null):-1)
06-20 12:27:44.649: W/dalvikvm(14842): threadid=6: spin on suspend #8 threadid=9 (pcf=0)
06-20 12:27:44.649: I/dalvikvm(14842): "Compiler" daemon prio=5 tid=6 VMWAIT
06-20 12:27:44.649: I/dalvikvm(14842):   | group="system" sCount=0 dsCount=0 obj=0x40510ff0 self=0x1a7d20
06-20 12:27:44.649: I/dalvikvm(14842):   | sysTid=14847 nice=0 sched=0/0 cgrp=default handle=619240
06-20 12:27:44.649: I/dalvikvm(14842):   at dalvik.system.NativeStart.run(Native Method)
06-20 12:27:44.649: I/dalvikvm(14842): "Thread-10" prio=5 tid=9 RUNNABLE
06-20 12:27:44.649: I/dalvikvm(14842):   | group="main" sCount=1 dsCount=0 obj=0x4052aa30 self=0x1e8c68
06-20 12:27:44.649: I/dalvikvm(14842):   | sysTid=14850 nice=0 sched=0/0 cgrp=default handle=2001728
06-20 12:27:44.679: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.nativeInit(Native Method)
06-20 12:27:44.679: I/dalvikvm(14842):   at surreal.quake3.engine.Camera9.<init>((null):-1)
06-20 12:27:44.679: I/dalvikvm(14842):   at surreal.quake3.engine.CameraVFP.<init>((null):-1)
06-20 12:27:44.679: I/dalvikvm(14842):   at surreal.quake3.engine.c.run((null):-1)
4

1 回答 1

0

哇,这是本机 C 代码的一个非常典型的情况,您通常在调试模式下测试应用程序编译并在发布模式下交付。

通常它会改变很多编译器使用的优化标志,并且应用程序对错误的内存指针、NULL 初始化等变得敏感。

我建议:

  • 检查用于调试和生产的 android.mk 文件是否具有相同的优化设置。检查优化级别(即 LOCAL_CFLAGS += -O3)

  • 获取您在市场上上传的 apk 并从 apk 安装应用程序。通过这种方式,您可以安全地排除市场本身所做的任何更改(如果有)

  • 如果使用 OpenGL,一旦应用程序由于 OpenGL 驱动程序崩溃而崩溃,我确实会遇到这种情况。在这种情况下,很难检查问题的根本原因。在我的情况下,这是由于指向脏内存位置的错误 VBO 标识符。就我而言,也没有生成 ANR。

  • 检查任何“内存不足”的情况。同样,有时,在 C 中,当您在调试时,变量 init 为零,并且您使用它们来分配内存。如果你没有自己初始化它们,当你去使用它和一个为发布库编译的时候,你会得到很多惊喜。其中之一可能是您的崩溃类型。

  • 检查“发布”版本触发的任何其他元素。在我之前的一个应用程序中,应用程序由于 admob(广告)错误而崩溃,该错误在 admob SDK 的测试模式中不存在。这也可以解释你的行为。

我希望这在某种程度上有所帮助。

干杯毛里齐奥

于 2012-06-21T13:49:04.553 回答