Manually set up your React Native Android App
These instructions are aimed at people manually adding Flipper to a React Native 0.62+ app. This should only be necessary if you have an existing app that cannot be upgraded with the React Native Upgrade tool.
Dependencies
Flipper is distributed via Maven Central. Add the dependencies to your build.gradle
file.
You should also explicitly depend on soloader
instead of relying on transitive dependency resolution which is getting deprecated
with Gradle 5.
These exclusions are currently necessary to avoid some clashes with FBJNI shared libraries.
Application Setup
For maximum flexibility, we recommend you move the Flipper initialization to a separate
class that lives in a debug/
folder, so that Flipper code never gets referenced in a
release build.
Note that this only enables the Layout Inspector plugin. Check out the React Native template for more plugins.
In your Application
implementation, we then call the static method using
reflection. This gives us a lot of flexibility, but can be quite noisy.
Alternatively, recreate an empty ReactNativeFlipper
class in a release/
folder,
so you can call into the method directly.
Further Steps
To create your own plugins and integrate with Flipper using JavaScript, check out our writing plugins for React Native tutorial!