question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Fresco initialized multiple times

See original GitHub issue

W/unknown:Fresco: Fresco has already been initialized! Fresco.initialize(...) should only be called 1 single time to avoid memory leaks!

If Android has already used Fresco in its native codes, which means we have already done

Fresco.initialize(this, config);

in our application.

The FrescoModule will still initialize Fresco, which causes fresco initialized twice.

  @Override
  public void initialize() {
    super.initialize();
    // Make sure the SoLoaderShim is configured to use our loader for native libraries.
    // This code can be removed if using Fresco from Maven rather than from source
    SoLoaderShim.setHandler(new FrescoHandler());

    Context context = getReactApplicationContext().getApplicationContext();
    Fresco.initialize(context, mConfig);
    mConfig = null;
  }

We should be able to disable the second initialize.

react-native 0.31, Mac, Android.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
midhun-muralicommented, Mar 21, 2018

I am too getting this issue in android. This is occuring again recently after I have updated my fresco to 1.8.1

0reactions
tasneembohracommented, Mar 8, 2018

I am getting this issue in 0.53 Fresco has already been initialized!Fresco.initialize(…) should only be called 1 single time to avoid memory leaks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Android] Fresco initialized multiple times | Voters | React Native
[Android] Fresco initialized multiple times. Nicolas Charpentier. Moved from https://github.com/facebook/react-native/issues/9558 · November 13, 2016.
Read more >
Fresco.initialize not working in Fragment - Stack Overflow
Fresco is not working when I am initializing it in the OnCreate or OnCreateView of the fragment. Is there something I am doing...
Read more >
Configuring the Image Pipeline - Fresco
Most apps can initialize Fresco completely by the simple command:
Read more >
Displaying Images with Fresco Library in Android - Section.io
Fresco was open-sourced for the first time in early 2015. ... To avoid the problem of an Android bitmap taking up a lot...
Read more >
Giphy Android App and Fresco
Testing the new app codebase showed promising results, except for the GIF rendering. Renditions took a lot of time to load and feedback...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found