wymsee / cordova-imagePicker

Cordova Plugin For Multiple Image Selection
MIT License
407 stars 854 forks source link

Plugin should use CordovaInterface.getThreadPool() #177

Open dersonsena opened 7 years ago

dersonsena commented 7 years ago

Hello everyone! Only in versions 6 and higher, to call the function "getPictures ()" is returning the following message:

THREAD WARNING: exec() call to ImagePicker.getPictures blocked the main thread for 23ms. Plugin should use CordovaInterface.getThreadPool().

More errors details:

FATAL EXCEPTION: AsyncTask #2
Process: com.imobsoft.imobvistoriaNew, PID: 1792
java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:309) at 
java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at 
java.util.concurrent.FutureTask.setException(FutureTask.java:223) at 
java.util.concurrent.FutureTask.run(FutureTask.java:242) at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at 
java.lang.Thread.run(Thread.java:818) Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=1792, uid=10060 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() at android.os.Parcel.readException(Parcel.java:1599) at
 android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183) at 
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135) at
 android.content.ContentProviderProxy.query(ContentProviderNative.java:421)  at
 android.content.ContentResolver.query(ContentResolver.java:491) at 

Thanks for plugin and hope to be helping.

deroguerre commented 7 years ago

Hi, i have the same issue when i use media plugin to recording audio =s

04-05 15:44:29.143: D/AudioPlayer(30885): stopping recording
04-05 15:44:29.144: D/AudioPlayer(30885): size = 1
04-05 15:44:29.144: D/AudioPlayer(30885): renaming /storage/emulated/0/tmprecording-1491399868142.3gp to /storage/emulated/0/men_audio/my_sound.3gp
04-05 15:44:29.145: E/AudioPlayer(30885): FAILED renaming /storage/emulated/0/tmprecording-1491399868142.3gp to /storage/emulated/0/men_audio/my_sound.3gp
04-05 15:44:29.145: W/PluginManager(30885): THREAD WARNING: exec() call to Media.stopRecordingAudio blocked the main thread for 44ms. Plugin should use CordovaInterface.getThreadPool().

cordova v6

matthewborgcarr commented 5 years ago

After intense debugging I managed to extract the following error log:

W/PluginManager: THREAD WARNING: exec() call to UniversalAnalytics.startTrackerWithId blocked the main thread for 34ms. Plugin should use CordovaInterface.getThreadPool().
    2018-09-09 22:13:56.522 22133-22233/com.myhurryapp.mbc W/CordovaPlugin: Attempted to send a second callback for ID: UniversalAnalytics******
        Result was: "Invalid action"
    2018-09-09 22:13:56.595 22133-22233/com.myhurryapp.mbc W/PluginManager: THREAD WARNING: exec() call to OneSignalPush.init blocked the main thread for 64ms. Plugin should use CordovaInterface.getThreadPool().
    2018-09-09 22:13:59.354 22133-22200/com.myhurryapp.mbc W/libEGL: EGLNativeWindowType 0x71c7a38010 disconnect failed
    2018-09-09 22:14:02.350 22133-22200/com.myhurryapp.mbc W/libEGL: EGLNativeWindowType 0x71c7a37010 disconnect failed

Now my concern and what I think is causing the app to crash are the following:

THREAD WARNING: exec() call to UniversalAnalytics.startTrackerWithId blocked the main thread for 34ms. Plugin should use CordovaInterface.getThreadPool().

and

THREAD WARNING: exec() call to OneSignalPush.init blocked the main thread for 64ms. Plugin should use CordovaInterface.getThreadPool().

I wonder what could be causing the freezing and Not Responding of the app and a possible work around to this issue?

Thanks