Saeed Badran Saeed Badran - 1 month ago 27
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$1.call(NativeAudio.java:119)
W/System.err: at com.rjfun.cordova.plugin.nativeaudio.NativeAudio$1.call(NativeAudio.java:117)
W/System.err: at com.rjfun.cordova.plugin.nativeaudio.NativeAudioAssetComplex.onCompletion(NativeAudioAssetComplex.java:166)
W/System.err: at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:2598)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err: at android.os.Looper.loop(Looper.java:215)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5373)
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)


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.

Answer

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