Zabs
Zabs

Reputation: 14142

Cordova application hangs after a few minutes of usage (Android app)

I have an Android Cordova/Angular JS application (not Ionic) that is running the latest version of Cordova (currently 7.0.1) - recently we have added a number of plugins related to using the Camera (see plugins below), the app itself is all working as intended however after 3-5 minutes of using the app it 'freezes' and becomes unusable.

Once it freezes the app seems to stay that way for a few minutes - the app itself doesn't actually crash/force quit but it seems to keep doing this and the user's only option is to close the app and re-open it to use it again.

I am testing this on a Galaxy Note 4 but it happens on my other devices also - Can anyone suggest what could be causing this, and what particular things should I be looking for within the adb logcat files?

So for the following seem to have popped up in the 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.

Any suggestions on how to start debugging this?

/ Plugins Installed / 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"

Upvotes: 0

Views: 848

Answers (1)

Somnath
Somnath

Reputation: 406

Remove this plugin

cordova-plugin-compat 1.1.0 "Compat"

and use

cordova platform remove android 
cordova platform add android
cordova platform run android

Upvotes: 0

Related Questions