我有一个基于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)
答案 0 :(得分:0)
通常它会改变编译器使用的优化标志,并且应用程序对错误的内存指针,NULL初始化等都是明智的。
我建议:
检查用于调试和生成的android.mk文件,编译库是否具有相同的优化设置。检查优化级别(即LOCAL_CFLAGS + = -O3)
带上你在市场上上传的apk并从apk安装应用程序。通过这种方式,您可以安全地排除市场本身所做的任何改动(如果有的话)
如果使用OpenGL,一旦应用程序因OpenGL驱动程序崩溃而崩溃,它确实发生在我身上。在这种情况下,很难检查问题的根本原因。在我的情况下,这是由于错误的VBO标识符指向脏内存位置。就我而言,也没有产生任何ANR。
检查是否有“内存不足”的情况。同样,有时,在C语言中,当您在调试时将变量init设置为零,并将它们用于malloc内存。如果你没有自己初始化它们,当你去编译发布库使用它时,你会得到很多惊喜。其中一个可能是你的崩溃类型。
检查“发布”版本触发的任何其他元素。在我之前的一个应用程序中,应用程序由于admob(广告)错误而崩溃,该错误在admob SDK的测试模式中不存在。这也可以解释你的行为。
我希望这会有所帮助。
干杯 莫里吉奥