当前位置: 代码迷 >> Android >> Android应用程序在某些机型上起步有几率一直黑屏
  详细解决方案

Android应用程序在某些机型上起步有几率一直黑屏

热度:45   发布时间:2016-04-28 06:42:21.0
Android应用程序在某些机型上启动有几率一直黑屏
本帖最后由 KongHuLu 于 2014-02-25 22:40:23 编辑
我们使用Mono for Android开发了一个App,发现在某些机型上(比如lenovo A3000-H)会打开会出现一直黑屏的情况,进不到程序的界面(同样也定位不到任何调试断点),而有些机型则不会。

通过仔细观察,发现在后台“当前运行程序”一栏,当成功启动时,程序所占体积是21mb左右。当启动失败时(一直黑屏),程序所占体积是9mb左右。

另外通过eclipse监控程序启动日志,对比发现了一些不同。

成功启动时的日志

02-24 16:00:47.038: I/ActivityManager(515): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.GDSCP.ModileEnforces/mobileenforces.BeginActivity} from pid 1016
02-24 16:00:47.073: W/Trace(515):   
02-24 16:00:47.078: I/BufferQueue(133): [unnamed-133-2248](this:0x41f5b448,api:0) BufferQueue
02-24 16:00:47.078: I/BufferQueue(133): [unnamed-133-2248](this:0x41f5b448,api:0) consumerConnect
02-24 16:00:47.078: I/BufferQueue(133): [unnamed-133-2248](this:0x41f5b448,api:0) setConsumerName: unnamed-133-2248
02-24 16:00:47.078: I/SurfaceTexture(133): [unnamed-133-2248](this:0x41f5e5e8,api:0) SurfaceTexture
02-24 16:00:47.078: I/BufferQueue(133): [unnamed-133-2248](this:0x41f5b448,api:0) setSynchronousMode: enabled=1
02-24 16:00:47.078: I/BufferQueue(133): [unnamed-133-2248](this:0x41f5b448,api:0) setDefaultBufferSize: w=1, h=1
02-24 16:00:47.078: I/BufferQueue(133): [Starting com.GDSCP.ModileEnforces](this:0x41f5b448,api:0) setConsumerName: Starting com.GDSCP.ModileEnforces
02-24 16:00:47.080: W/Trace(515):   

02-24 16:00:47.085: I/BufferQueue(133): [Starting com.GDSCP.ModileEnforces](this:0x41f5b448,api:0) setDefaultBufferSize: w=1024, h=552
02-24 16:00:47.088: W/Trace(515):   

02-24 16:00:47.093: E/Launcher(1016): new onSaveInstanceState <F2><F2><F2><F2><F2><F2><F2><F2><F2><F2><F2><F2><F2><F2>
02-24 16:00:47.094: E/Launcher(1016): onPause flag orientation falg        =2
02-24 16:00:47.097: W/Trace(515):   

  
02-24 16:00:47.109: I/BufferQueue(133): [Starting com.GDSCP.ModileEnforces](this:0x41f5b448,api:0) connect: api=2

02-24 16:00:47.109: I/BufferQueue(133): [Starting com.GDSCP.ModileEnforces](this:0x41f5b448,api:2) setSynchronousMode: enabled=1

02-24 16:00:47.109: I/BufferQueue(133): [Starting com.GDSCP.ModileEnforces](this:0x41f5b448,api:2) new GraphicBuffer needed

02-24 16:00:47.113: I/GraphicBuffer(133): allocate buffer (w:1024 h:552 f:1) err(0)


02-24 16:00:47.115: I/ActivityManager(515): Start proc com.GDSCP.ModileEnforces for activity com.GDSCP.ModileEnforces/mobileenforces.BeginActivity: pid=2225 uid=10106 gids={50106, 3003, 1015, 1028}
02-24 16:00:47.117: W/Trace(515):   


02-24 16:00:47.117: W/Trace(515):   
02-24 16:00:47.118: I/BufferQueue(133):     [NEW] gb=0x41f63690, handle=0x41f63090, w=1024, h=552, s=1024, fmt=1
02-24 16:00:47.125: W/Trace(515):   
02-24 16:00:47.135: I/SurfaceTexture(133): [Starting com.GDSCP.ModileEnforces](this:0x41f5e5e8,api:2) [void* android::SurfaceTexture::createImage(EGLDisplay, const android::sp<android::GraphicBuffer>&)]
02-24 16:00:47.138: W/Trace(1016):   ///////////////////////
02-24 16:00:47.150: I/com.umeng.common.b(1016): Could not get location from GPS or Cell-id, lack ACCESS_COARSE_LOCATION or ACCESS_COARSE_LOCATION permission?
02-24 16:00:47.160: W/Trace(2225):   
02-24 16:00:47.160: W/Trace(2225):   
02-24 16:00:47.167: W/ADB_SERVICES(2431): create_local_service_socket() name=jdwp:2225
02-24 16:00:47.168: W/ADB_SERVICES(2431): looking for pid 2225 in JDWP process list return fds0(18) fds1(20)
02-24 16:00:47.168: W/ADB_SERVICES(2431): trying to write to JDWP socket=16 pid=2225 count=1 out_fds=20
02-24 16:00:47.182: W/Trace(515):   
02-24 16:00:47.184: W/Trace(515):   
02-24 16:00:47.184: I/WindowManager(515): Losing focus: Window{41b51e38 u0 com.lenovo.launcher/com.lenovo.launcher2.Launcher}
02-24 16:00:47.184: W/Trace(515):   
02-24 16:00:47.205: W/Trace(515):   
02-24 16:00:47.214: I/ActivityThread(2225): Pub com.GDSCP.ModileEnforces.mono.MonoRuntimeProvider.__mono_init__: mono.MonoRuntimeProvider
02-24 16:00:47.218: W/MonoDroid-Debugger(2225): Not starting the debugger as the timeout value has been reached; current-time: 1393228847  timeout: 1392886499
02-24 16:00:47.227: E/mono(2225): WARNING: The runtime version supported by this application is unavailable.
02-24 16:00:47.229: E/mono(2225): Using default runtime: v2.0.50727
  相关解决方案