【发布时间】:2017-08-24 11:08:00
【问题描述】:
我有一个运行最新版本的 Cordova(当前为 7.0.1)的 Android Cordova/Angular JS 应用程序(不是 Ionic) - 最近我们添加了一些与使用相机相关的插件(请参阅下面的插件),该应用程序本身都按预期工作,但是在使用该应用程序 3-5 分钟后,它“冻结”并变得无法使用。
一旦冻结,应用程序似乎会保持这种状态几分钟 - 应用程序本身实际上并没有崩溃/强制退出,但它似乎会继续这样做,用户唯一的选择是关闭应用程序并重新打开它可以再次使用它。
我正在 Galaxy Note 4 上对此进行测试,但它也发生在我的其他设备上 - 任何人都可以提出可能导致此问题的原因,以及我应该在 adb logcat 文件中查找哪些特定内容?
所以对于以下似乎已经在 logcat 中弹出 -
W/PluginManager: THREAD WARNING: exec() call to Camera.takePicture blocked the main thread for 57ms. Plugin should use CordovaInterface.getThreadPool()
W/FileTransfer: setFixedLengthStreamingMode could cause OutOfMemoryException - switch to chunkedMode=true to avoid it if this is an issue.
W/art: Suspending all threads took: 5.212ms
D/CordovaActivity: Paused the activity.
关于如何开始调试有什么建议吗?
/ 已安装插件 /
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.0 "Whitelist"
【问题讨论】:
-
当您使用 PhoneGap github.com/phonegap/phonegap/wiki/Debugging-in-PhoneGap 时,您可以在此页面上获得所有调试选项并尝试 Remote Debugging Tools for Chrome 或类似 Weinre 的工具。这些工具将显示是否存在阻塞主线程或导致应用程序挂起的 javascript 错误。
标签: android angularjs cordova cordova-plugins ngcordova