Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 140 forks source link

Warning on app start #6

Closed rabihs closed 9 years ago

rabihs commented 11 years ago

I get the following warning when my application starts

THREAD WARNING: exec() call to PushNotification.registerDevice blocked the main thread for 36ms. Plugin should use CordovaInterface.getThreadPool().

Is there a fix for that? Thanks.

shaders commented 11 years ago

Hi,

That's very strange as all the network activity (that might block the thread) is happening on the background thread. Meanwhile our team is checking the issue.

Thanks!

shaders commented 11 years ago

Hi,

Any chance to get full logs from the device? Also is it for iOS or Android?

Thanks!

rabihs commented 11 years ago

I'm using Android.

Please find the log below:

09-24 16:32:25.189: W/IInputConnectionWrapper(24146): showStatusIcon on inactive InputConnection 09-24 16:32:25.409: I/GATE(24146): DEV_ACTION_COMPLETED 09-24 16:32:45.059: I/System.out(25535): Sending WAIT chunk 09-24 16:32:45.059: W/ActivityThread(25535): Application com.pswgroup.veefm is waiting for the debugger on port 8100... 09-24 16:32:45.074: I/dalvikvm(25535): Debugger is active 09-24 16:32:45.259: I/System.out(25535): Debugger has connected 09-24 16:32:45.264: I/System.out(25535): waiting for debugger to settle... 09-24 16:32:45.464: I/System.out(25535): waiting for debugger to settle... 09-24 16:32:45.664: I/System.out(25535): waiting for debugger to settle... 09-24 16:32:45.869: I/System.out(25535): waiting for debugger to settle... 09-24 16:32:46.064: I/System.out(25535): waiting for debugger to settle... 09-24 16:32:46.264: I/System.out(25535): waiting for debugger to settle... 09-24 16:32:46.464: I/System.out(25535): waiting for debugger to settle... 09-24 16:32:46.664: I/System.out(25535): debugger has settled (1454) 09-24 16:32:46.934: D/CordovaActivity(25535): Setting integer properties in CordovaActivity will be deprecated in 3.0 on July 2013, please use config.xml 09-24 16:32:47.299: I/webclipboard(25535): clipservice: android.sec.clipboard.ClipboardExManager@41e0e230 09-24 16:32:47.569: D/CordovaWebView(25535): CordovaWebView is running on device made by: samsung 09-24 16:32:47.579: D/JsMessageQueue(25535): Set native->JS mode to 2 09-24 16:32:47.754: D/dalvikvm(25535): GC_FOR_ALLOC freed 277K, 7% free 12217K/13063K, paused 35ms, total 35ms 09-24 16:32:47.789: I/dalvikvm-heap(25535): Grow heap (frag case) to 15.979MB for 3686416-byte allocation 09-24 16:32:47.819: D/dalvikvm(25535): GC_FOR_ALLOC freed 1K, 6% free 15815K/16711K, paused 32ms, total 32ms 09-24 16:32:47.874: D/dalvikvm(25535): GC_CONCURRENT freed <1K, 6% free 15818K/16711K, paused 13ms+12ms, total 54ms 09-24 16:32:48.289: D/libEGL(25535): loaded /system/lib/egl/libEGL_mali.so 09-24 16:32:48.364: D/libEGL(25535): loaded /system/lib/egl/libGLESv1_CM_mali.so 09-24 16:32:48.364: D/libEGL(25535): loaded /system/lib/egl/libGLESv2_mali.so 09-24 16:32:48.369: D/(25535): Device driver API match 09-24 16:32:48.369: D/(25535): Device driver API version: 10 09-24 16:32:48.369: D/(25535): User space API version: 10 09-24 16:32:48.369: D/(25535): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Tue Oct 16 15:37:13 KST 2012 09-24 16:32:48.519: D/OpenGLRenderer(25535): Enabling debug mode 0 09-24 16:32:49.104: I/Choreographer(25535): Skipped 33 frames! The application may be doing too much work on its main thread. 09-24 16:32:51.804: I/GATE(25535): DEV_ACTION_COMPLETED 09-24 16:32:52.619: D/TilesManager(25535): new EGLContext from framework: 5d307ac0 09-24 16:32:52.619: D/GLWebViewState(25535): Reinit shader 09-24 16:32:52.684: D/GLWebViewState(25535): Reinit transferQueue 09-24 16:32:53.354: E/SpannableStringBuilder(25535): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 09-24 16:32:53.354: E/SpannableStringBuilder(25535): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 09-24 16:32:54.069: D/PushNotifications(25535): Plugin Called 09-24 16:32:54.079: D/PushNotifications(25535): Plugin Called 09-24 16:32:54.134: W/PushWoosh DeviceFeature2_5(25535): Try To sent AppOpen 09-24 16:32:54.169: W/PushEventsTransmitter(25535): No android.permission.BROADCAST_STICKY. Reverting to simple broadcast 09-24 16:32:54.174: W/PluginManager(25535): THREAD WARNING: exec() call to PushNotification.registerDevice blocked the main thread for 95ms. Plugin should use CordovaInterface.getThreadPool(). 09-24 16:32:54.299: D/dalvikvm(25535): GC_CONCURRENT freed 596K, 7% free 16471K/17671K, paused 9ms+3ms, total 28ms 09-24 16:32:55.114: W/PushWoosh: NetworkUtils(25535): PushWooshResult: {"status_code":200,"status_message":"OK","response":null} 09-24 16:32:55.119: W/PushWoosh DeviceFeature2_5(25535): Send AppOpen success 09-24 16:33:02.689: I/MediaPlayer(25535): Don't send intent. msg.arg1 = 0, msg.arg2 = 0 09-24 16:33:25.099: W/IInputConnectionWrapper(25535): getSelectedText on inactive InputConnection 09-24 16:33:25.104: W/IInputConnectionWrapper(25535): setComposingText on inactive InputConnection 09-24 16:33:25.124: W/IInputConnectionWrapper(25535): getExtractedText on inactive InputConnection 09-24 16:33:56.279: W/IInputConnectionWrapper(25535): showStatusIcon on inactive InputConnection

shaders commented 11 years ago

Mostly this is harmless issue as from the Phonegap PluginManager code I can see that it doesn't really check if plugin blocks main or background thread: https://github.com/apache/cordova-android/blob/master/framework/src/org/apache/cordova/PluginManager.java See execHelper function, it could be called on "runOnUiThread" as well as in background.

Anyway our team is looking deeply into the issue. Thanks!

rabihs commented 11 years ago

Thank you for your help. The issue is not a blocking point and the app is working well with the plugin. Next I'm going to use it with iOS.

saniyusuf commented 11 years ago

I see this issue on IOS7 but my puswoosh doesnt work as i do not see the popup that asks for users subscription.

shaders commented 11 years ago

Please double check that you are using correct mobileprovisioning profile with aps-environment string in it. Also if you are using Phonegap Build make sure you use Production (AdHoc) profile.

vishnuc156 commented 10 years ago

THREAD WARNING: exec() call to LocationTrackPlugin.GetLocation blocked the main thread for 32ms. Plugin should use CordovaInterface.getThreadPool().

I got the same issue when call the native android service and broad cast receiver.

Please give me a suggestion to overcome this

shaders commented 10 years ago

Hi,

This actually a bug in Phonegap. Plugin uses background thread, however Phonegap does not detect that :( I remember having this discussion with PGB team, hopefully it would be fixed on their side some day.