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?

Savvas Dalkitsis
  • 11,476
  • 16
  • 65
  • 104
Karim Varela
  • 7,562
  • 10
  • 53
  • 78

2 Answers2

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)
Karim Varela
  • 7,562
  • 10
  • 53
  • 78
  • 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. – Savvas Dalkitsis Oct 30 '13 at 11:22
  • 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. – Jake Wharton Oct 30 '13 at 15:24
  • 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? – Savvas Dalkitsis Oct 30 '13 at 15:28
  • @JakeWharton, I can confirm this answer. Using Picasso.with(Context) instead of using the builder fixed the issue in our project. – interlude Mar 05 '15 at 08:05
  • 2
    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. – Jake Wharton Mar 05 '15 at 15:17
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

Savvas Dalkitsis
  • 11,476
  • 16
  • 65
  • 104
  • 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; } – markshiz Jul 09 '14 at 16:40
  • 1
    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. – Jake Wharton Mar 05 '15 at 15:16