Android - How to setup dependencies when Flipper is only used in debug builds?
See original GitHub issueIn my Application onCreate I have
if (BuildConfig.DEBUG) {
SoLoader.init(this, false);
if (FlipperUtils.shouldEnableFlipper(this)) {
final FlipperClient client = AndroidFlipperClient.getInstance(this);
client.addPlugin(new NetworkFlipperPlugin());
client.addPlugin(new InspectorFlipperPlugin(this, DescriptorMapping.withDefaults()));
client.addPlugin(CrashReporterPlugin.getInstance());
client.start();
}
}
and in my app level build.gradle I have:
implementation 'com.facebook.flipper:flipper:0.16.2'
implementation 'com.facebook.soloader:soloader:0.5.1'
but, if my hunch is right… this means flipper is technically being shipped in release builds. How can I prevent this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Adding Flipper to Android apps with Gradle
To set up Flipper for Android, you need to add the necessary dependencies to your app, initialize the Flipper client and enable the...
Read more >Flipper implementation assambleRelease error - Stack Overflow
I am trying to assemble my app in Android ...
Read more >Using Flipper with React Native - Parashuram's blog
In <your_rn_app>/android/app/build.gradle, inside dependencies section, add these lines for including Flipper in the project. Note that in the ...
Read more >Installation | React Native Reanimated - Software Mansion
Please note that Reanimated 2 doesn't support remote debugging, only Flipper can be used for debugging. First step is to install react-native-reanimated alpha ......
Read more >Debugging React Native apps with Flipper - LogRocket Blog
I spotted Flipper earlier when a project I was working on used an older version of React Native, but I didn't want to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ColtonIdle @passy I came up with this as a temporary working solution until it’s done in Flipper’s core package. https://github.com/theGlenn/flipper-android-no-op
If a no-op variant isn’t needed (or deemed the right solution) then yes, docs would be helpful. I just came across another reddit comment that said they tried flipper, didn’t compile so they dropped it and haven’t used it since. (Unfortunately) I feel like setup instructions should be fairly comprehensive so new and old developers have as little friction as possible.
If you recommend debugCompile, then I would at least include something about it failing in release and giving the user the 3 (?) possible options forward. Something like the below:
As far as I can tell from what I’ve read, it might be best to have a separate init class that I create myself as the no-op methods may still increase my method count? Not sure. Anyway, these are just my thoughts. I love flipper and would just love to make it the goto tool you include in any new app.