在一些设备上,某种条件下调用Unity C#的Application.quit()接口会导致闪退。需要改为调用Android原生接口,代码如下:

activity.finish();
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);

报错如下:

10403-28 18:27:05.162 25084 25084 W Unity : Timeout while trying to pause the Unity Engine.
10503-28 18:27:05.191 25084 25084 E ANR_LOG : >>> msg's executing time is too long
10603-28 18:27:05.192 25084 25084 E ANR_LOG : Blocked msg = { when=-4s32ms what=102 target=android.app.ActivityThread$H obj=android.os.BinderProxy@3bfac69e } , cost = 4032 ms
10703-28 18:27:05.192 25084 25084 E ANR_LOG : >>>Current msg List is:
10803-28 18:27:05.192 25084 25084 E ANR_LOG : Current msg <1> = { when=-4s32ms what=0 target=android.os.Handler callback=$Proxy3 }
10903-28 18:27:05.192 25084 25084 E ANR_LOG : Current msg <2> = { when=-4s30ms what=0 target=android.os.Handler callback=com.unity3d.player.UnityPlayer$8 }
11003-28 18:27:05.192 25084 25084 E ANR_LOG : Current msg <3> = { when=-4s26ms what=0 target=android.app.ActivityThread$H callback=android.app.LoadedApk$ServiceDispatcher$RunConnection }
11103-28 18:27:05.192 25084 25084 E ANR_LOG : Current msg <4> = { when=-3s994ms what=0 target=android.app.ActivityThread$H callback=android.app.LoadedApk$ServiceDispatcher$RunConnection }
11203-28 18:27:05.193 25084 25084 E ANR_LOG : Current msg <5> = { when=-3s896ms what=17 target=android.view.ViewRootImpl$ViewRootHandler obj=android.view.ViewRootImpl$SystemUiVisibilityInfo@359d6abc }
11303-28 18:27:05.193 25084 25084 E ANR_LOG : Current msg <6> = { when=-3s894ms what=118 target=android.app.ActivityThread$H obj={1.12 ?mcc?mnc zh_CN ?layoutDir sw360dp w360dp h622dp 480dpi nrml long port finger -keyb/v/h -nav/h s.44mThemeChanged = 0mThemeChangedFlags = 0mFlipFont = 0} }
11403-28 18:27:05.193 25084 25084 E ANR_LOG : Current msg <7> = { when=-3s881ms what=2 target=android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate }
11503-28 18:27:05.193 25084 25084 E ANR_LOG : Current msg <8> = { when=-3s881ms what=2 target=android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate }
11603-28 18:27:05.194 25084 25084 E ANR_LOG : Current msg <9> = { when=-3s864ms what=8 target=android.view.ViewRootImpl$ViewRootHandler }
11703-28 18:27:05.194 25084 25084 E ANR_LOG : Current msg <10> = { when=-3s864ms what=130 target=com.android.internal.view.IInputConnectionWrapper$MyHandler arg1=247 }
11803-28 18:27:05.194 25084 25084 E ANR_LOG : Current msg <11> = { when=-3s862ms what=3 target=android.view.SurfaceView$1 }
11903-28 18:27:05.194 25084 25084 E ANR_LOG : Current msg <12> = { when=-3s862ms what=5 target=android.view.ViewRootImpl$ViewRootHandler obj=com.android.internal.os.SomeArgs@13f3ea45 }
12003-28 18:27:05.204 25084 25084 E ANR_LOG : Current msg <13> = { when=-3s855ms what=4 target=android.view.inputmethod.InputMethodManager$H }
12103-28 18:27:05.204 25084 25084 E ANR_LOG : Current msg <14> = { when=-3s855ms what=3 target=android.view.inputmethod.InputMethodManager$H arg1=331 }
12203-28 18:27:05.205 25084 25084 E ANR_LOG : Current msg <15> = { when=-3s807ms what=100 target=com.android.internal.view.IInputConnectionWrapper$MyHandler }
12303-28 18:27:05.205 25084 25084 E ANR_LOG : Current msg <16> = { when=-3s807ms what=65 target=com.android.internal.view.IInputConnectionWrapper$MyHandler }
12403-28 18:27:05.205 25084 25084 E ANR_LOG : Current msg <17> = { when=-3s761ms what=17 target=android.view.ViewRootImpl$ViewRootHandler obj=android.view.ViewRootImpl$SystemUiVisibilityInfo@699f59a }
12503-28 18:27:05.205 25084 25084 E ANR_LOG : Current msg <18> = { when=-3s731ms what=0 target=android.app.ActivityThread$H callback=android.app.LoadedApk$ServiceDispatcher$RunConnection }
12603-28 18:27:05.205 25084 25084 E ANR_LOG : Current msg <19> = { when=-3s462ms what=140 target=android.app.ActivityThread$H arg1=20 }
12703-28 18:27:05.205 25084 25084 E ANR_LOG : Current msg <20> = { when=-3s462ms what=109 target=android.app.ActivityThread$H arg1=1 obj=android.os.BinderProxy@3bfac69e }
12803-28 18:27:05.205 25084 25084 E ANR_LOG : >>>CURRENT MSG DUMP OVER<<<

Unity : Timeout while trying to pause the Unity Engine.应用闪退问题修复相关推荐

  1. Unity导出到AS中真机测试apk没有问题,aab提交到GooglePlay审核通过,但是从Google Play下载的应用闪退问题

    兄弟们,姐妹们,历尽两个月,改得我都怀疑自己适不适合搞这行了!!!真的是把网上说得可能得问题和解决方法都尝试了一遍,快疯了!! 看google开发者后台得测试报告,提供得crash信息: signal ...

  2. unity 天空盒_使用Substance in Unity搭建Unity和SP的live link实时互通环境

    一.Substance in Unity的live link的作用 作为TA,首先应该关注的就是一个流畅高效的工作流,使美术在一个稳定高效的环境下进行美术资产的制作.现在的游戏开发,PBR资产的贴图一 ...

  3. 一次UNITY闪退问题的定位心得

    一次UNITY闪退问题的定位心得 最近项目测试发现,运行unity后不退出运行模式,玩了一局后点击 "再来一局",反复十几局后unity崩掉. 经观察,发现在这十几局的过程中,un ...

  4. (转)[EntLib]微软企业库5.0 学习之路——第十步、使用Unity解耦你的系统—PART2——了解Unity的使用方法(1)...

    原文地址:http://www.cnblogs.com/kyo-yo/archive/2010/11/01/Learning-EntLib-Tenth-Decoupling-Your-System-U ...

  5. 【Unity开源项目精选】UniRx:Unity中的响应式编程

    洪流学堂,让你快人几步.你好,我是你的技术探路者郑洪智,你可以叫我大智. 本篇文章首发于我的公众号:洪流学堂 今天给你分享一个Unity开源项目,我们一起来看看吧! UniRx是什么? UniRx ( ...

  6. 【Unity开源项目精选】Entitas:Unity DOTS的先行者

    洪流学堂,让你快人几步.你好,我是你的技术探路者郑洪智,你可以叫我大智. Entitas Entitas是Unity官方推出DOTS之前的一个开源ECS框架.不过自从Unity官方启动DOTS以来,E ...

  7. 【Unity开源项目精选】xLua:Unity热更新首选

    洪流学堂,让你快人几步.你好,我是你的技术探路者郑洪智,你可以叫我大智. 今天给你分享一个Unity开源项目,我们一起来看看吧! xLua C#下Lua编程支持: xLua为Unity. .Net. ...

  8. Unity 5.6正式版发布,Unity 2017即将来临

    最新版Unity 5.6正式发布,也是Unity 5.x系列的最后一个版本.其中包括改进的2D功能,更好的图形性能,新的视频播放器,Progressive Lightmapper预览版,新的光照模式, ...

  9. 【Unity 3D 从入门到实战】Unity 3D 组件总结

    目录 一,前言 二,常用组件 1,Transform 组件 2,Mesh Filter 组件 3,Box Collider 组件 4,Rigidbody 组件 5,脚本组件 三,总结 一,前言 组件是 ...

  10. Unity 接入第三方SDK打包闪退

    在接入穿山甲sdk的时候,打包apk的时候出现适配部分机型,部分机型闪退,出现如下错误 图中可以看出是.so文件引起的问题. 接入第三方sdk的时候,有时候常常需要导入第三方jar包以及aar包,有些 ...

最新文章

  1. uva 11020 - Efficient Solutions
  2. Linux下去掉Windows文件的^M
  3. Daily Scrum9 11.13
  4. BZOJ 2281 Luogu P2490 [SDOI2011]黑白棋 (博弈论、DP计数)
  5. 有了这套模板,女朋友再也不用担心我刷不动 LeetCode 了
  6. Windows破解笔记-windows API中的SendMessage
  7. 100g光模块厂家排名_100G光模块固件设计示例
  8. Spring框架对JDBC的简单封装。提供了一个JDBCTemplate对象简化JDBC的开发
  9. 浏览器根对象window之caches
  10. 【实战应用】后端返回支付宝HTML,如何使用.H5端调用支付宝支付
  11. 揭秘:客服如何创造价值和自我超越
  12. 手机自带浏览器的强大
  13. CSS基础教程17篇 [翻译Htmldog]
  14. 极限中0除以常数_0的美好
  15. androidnbsp;网络联接nbsp;CMWAPnbsp;CTWAP
  16. ubuntu 使用LVM修改分区大小后开机报错的解决办法
  17. 简单解决Edge浏览器被sb360篡改的方法
  18. 虚拟化技术——VLAN策略
  19. VBA宏批量处理多个Word文档
  20. 拼多多or云集微店,社交电商分轨而驰

热门文章

  1. html <font>中英文常用字体和颜色总结
  2. 用while循环 从1加到100
  3. Shell(Bash)单引号、双引号、不加引号和反引号用法详解
  4. android 朗读tts_如何设置Android以大声朗读您的文本
  5. css+div透明参数设置
  6. Lvs之NAT、DR、TUN三种模式的应用配置案例
  7. c语言美元符号用法,R函数()中美元符号“$”的含义是什么?
  8. 目标跟踪数据集整理(三)----GOT-10k
  9. RuntimeError: sizes of tensors must match except in dimension 2. Got 37 and 36
  10. Wi-Fi放大器、中继、桥接和mesh组网的理解