Saeed Badran Saeed Badran - 3 months ago 45
Android Question

Cordova app is too slow only when wifi and Mobile Data are running on (some of) Android phones, Any tips how to debug the issue?

I'm debugging a project that was done by someone else. I'm using Cordova 5.4.1 platform, Android Studio 2.1.3 IDE, and on Mac OS.

The issue happens only on some android devices (e.g. Sony xperia z3v, Galaxy S7 edge) and not all.

The issue is solved if I disable both wifi and mobile data. I figured this much after watching many ConnectivityManager warnings on the LogCat view, right before the delay, every single time.

D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290

If it helps, here is a list of all plugins used in this app:

com.bunkerpalace.cordova.YoutubeVideoPlayer 1.0.1 "CordovaYoutubeVideoPlayer"
com.sgil.libpd 0.2.11 "Libpd"
com.verso.cordova.clipboard 0.1.0 "Clipboard"
cordova-instagram-plugin 0.5.3 "Instagram"
cordova-plugin-app-version 0.1.8 "AppVersion"
cordova-plugin-appsee 2.2.1 "Appsee"
cordova-plugin-camera 2.2.0 "Camera"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-contacts 2.1.0 "Contacts"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-dialogs 1.2.1 "Notification"
cordova-plugin-file 4.2.0 "File"
cordova-plugin-file-transfer 1.5.2-dev "File Transfer"
cordova-plugin-flurryanalytics 1.1.0 "Flurry Analytics"
cordova-plugin-geolocation 2.2.0 "Geolocation"
cordova-plugin-googleplayservices 19.0.3 "Google Play Services for Android"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-inapppurchase 1.0.0 "In App Purchase"
cordova-plugin-media 2.3.0 "Media"
cordova-plugin-nativeaudio 3.0.7 "Cordova Native Audio"
cordova-plugin-network-information 1.2.1 "Network Information"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-transport-security 0.1.2 "App Transport Security"
cordova-plugin-whitelist 1.2.2 "Whitelist"
cordova-plugin-x-socialsharing 5.1.1 "SocialSharing"
cordova-sqlite-storage 1.4.1 "Cordova sqlite storage plugin"

Using LogCat, I noticed the following system error is very often whenever the delay happens (not every single time though, but most of them):

W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.HashMap.get(java.lang.Object)' on a null object reference
W/System.err: at com.rjfun.cordova.plugin.nativeaudio.NativeAudio$
W/System.err: at com.rjfun.cordova.plugin.nativeaudio.NativeAudio$
W/System.err: at com.rjfun.cordova.plugin.nativeaudio.NativeAudioAssetComplex.onCompletion(
W/System.err: at$EventHandler.handleMessage(
W/System.err: at android.os.Handler.dispatchMessage(
W/System.err: at android.os.Looper.loop(
W/System.err: at
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at java.lang.reflect.Method.invoke(
W/System.err: at$
W/System.err: at

What I need is hints and tips on how to track/debug this type of issue (e.g. how to track network connection)? tools? or if you been through similar situation before and what helped to solve it.

Thanks in Advance.


I found the cause of the problem, it was because of the appsee plugin. Once it was stopped (or uninstalled later) the problem solved.