A/Looper: Could not create wake pipe. errno=24
Asked Answered
S

2

9

We're building an app that does a lot of animations and downloads a lot of images. After a certain amount of transactions (a predictable number), the app is crashing with the error:

A/Looper: Could not create wake pipe. errno=24

We don't use Looper in our code, but a few of the libraries we use do use Looper:

  1. ActionBarSherlock: I don't think this is the culprit
  2. facebook: I don't think this is the culprit
  3. nineoldandroid: This animation library could be the culprit
  4. volley: This is probably not the culprit
  5. Picasso: This could be the culprit

Has any body experienced this Looper error with any of these libs and knows how to fix?

Strong answered 12/7, 2013 at 1:19 Comment(0)
S
6

The problem was in the Picasso lib. We weren't using it in the intended fashion. We were holding on to a copy of the Picasso builder.

We avoided this problem by always using

Picasso.with(Context).load(Url).into(ImageView)
Strong answered 13/7, 2013 at 1:42 Comment(5)
Can you elaborate on this a bit more? We have the same issue but we are not holding on to a reference of the builder. We hold on to an instance of the Picasso class that is not the internal singleton created by the with method.Earthenware
The global singleton uses the builder to create its instance so this is no different than using your own instance. We've deployed Picasso to millions of devices using a custom instance without seeing this problem.Sommersommers
Could it be related to either not calling the shutdown method (which is inexplicably, only available on the non-default singleton) or if there are two or more instances of Picasso hanging around?Earthenware
@JakeWharton, I can confirm this answer. Using Picasso.with(Context) instead of using the builder fixed the issue in our project.Debug
Sorry, but you are wrong. The problem is likely that you are using the builder on every call to Picasso and not reusing the created instance. There is absolutely nothing wrong with the builder.Sommersommers
E
3

For us, the problem was the fact that we had two different instances of Picasso lying around. If you use the builder to create a custom instance but make sure no other instance is created elsewhere in your app, then this problem shouldn't appear

Earthenware answered 30/10, 2013 at 17:57 Comment(2)
Indeed, it appears as if you should only ever have one instance. That is, if you need to have one for your app, you should create your own wrapper Singleton. This is in fact what the with() method does in their own library. public static Picasso with(Context context) { if (singleton == null) { synchronized (Picasso.class) { if (singleton == null) { singleton = new Builder(context).build(); } } } return singleton; }Gelhar
Multiple instances are fine and are not the cause of this. If you are creating thousands of instances by not reusing created ones this will likely happen.Sommersommers

© 2022 - 2024 — McMap. All rights reserved.