15

I am getting this when using a recycle view along with Picasso library to fetch images from sound cloud. The problem is that the app freezes for few seconds sometimes. Then, I get a message of skipping frames and doing too much work on the main thread. I am using retrofit to perform the Http connection.

I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
KnoxVpnUidStorageknoxVpnSupported API value returned is false
I/Choreographer: Skipped 102 frames!  The application may be doing too much work on its main thread.
OneCricketeer
  • 151,199
  • 17
  • 111
  • 216
jelmood jasser
  • 800
  • 1
  • 12
  • 30
  • Possible Duplicate of http://stackoverflow.com/questions/14678593/the-application-may-be-doing-too-much-work-on-its-main-thread – OneCricketeer Sep 04 '16 at 03:39
  • And `I/System.out` is simply an INFO message from `System.out.println`, not necessarily an error or anything to care about – OneCricketeer Sep 04 '16 at 03:40
  • Another possible duplicate. http://stackoverflow.com/questions/30360823/how-do-i-fix-whatever-is-causing-this-to-flood-my-logcat-i-system-out-httplog – OneCricketeer Sep 04 '16 at 03:43

7 Answers7

32

The reason for App freezing is because of the error " The application may be doing too much work on its main thread". The reason for this error is maybe you are trying to download images of a bigger size which is exceeding the app memory.Using large size images or resource files also causes this error. "isSBSettingEnabled false" is may be because of using HttpUrlConnection, this mainly occurs while using Samsung devices. Try using emulator.

Jahnavi Nandamuri
  • 391
  • 1
  • 5
  • 9
  • Best answer so far. I have the same issue. The threads seem to get stuck when trying to download too many images using the "picasso" library. – rubmz Jul 02 '17 at 11:35
  • I'm using J7 Prime and Samsung Tab 3 their API is level 23 and 19. In Tab 3 all is smooth. But in j7 prime which is Marshmallow. This error occurs. – Android Mediocre Sep 25 '17 at 04:09
  • 3
    same for me with SAMSUNG device – James Chan Nov 26 '19 at 15:50
  • 1
    I am doing google sign in flutter. So why I am getting these warning or log because as I am not downloading any data from the internet. What is the reason can anybody tell? Ignoring header X-Firebase-Locale because its value was null. also I am getting this. but my login is successfull – Dhananjay Gavali Apr 06 '21 at 13:58
  • Same, Am using Samsung S8+ – Srihari Jul 12 '21 at 12:44
  • I'm recently having this issue. Is it like a Samsung thing or something? – Jay N May 19 '22 at 02:55
4

I may be too late but it can help someone. I encountered this situation in two case. First situation I was trying to download something big and doing simultaneous download, I was not quite sure if it was a problem but I changed the mechanism for download and used okhttp. Second time Yes it was also in downloading but this time it was a bad URL that I was using: http://example.com/file to download.pdf (look here space was the problem). Formatting the URL was the only thing to fix it.

1

Change the compile sdk version to 27, I also faced the same issue with my app, just replace the compilesdk version to 27,

Hope it helps!

  • I have a game that connects to socket.io and was having this issue, it wouldn't connect to the server, this solution worked for me, care to explain with details? It's weird because it started when I downloaded the latest android version – centenond Apr 18 '19 at 07:17
1

You can try to add this attribute to your part in the AndroidManifest.xml

android:usesCleartextTraffic="true"

This could solve the problem on my app.

Dharman
  • 26,923
  • 21
  • 73
  • 125
SparkRTG
  • 31
  • 6
0

I tried simply changing the target not even the compiledsdkVersion and it worked! :

targetSdkVersion 27

edit :

However to upload on google play your targetSdk version must not be lower than the compiledSdk

Phil
  • 273
  • 1
  • 3
  • 12
-1

You should increase the request timeout, that's how:

1) Subclass a Downloader class

2) Preconfigure OkHttpClient with timeouts and pass it to Picasso

xKobalt
  • 1,498
  • 2
  • 12
  • 19
-5

add this in AndroidMainfest and try

<uses-permission android:name="android.permission.INTERNET"></uses-permission>