theGlenn / flipper-android-no-op

No-op dependency for Flipper Android release mode

Home Page:https://fbflipper.com/docs/getting-started/android-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flipper-android-no-op

No-op dependency when using Flipper Android in release mode.

GitHub Contribute

Getting started

In your build.gradle:

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}
...

dependencies {
    //The important part
    def flipper_version = '0.191.1'
    debugImplementation "com.facebook.flipper:flipper:$flipper_version"
    debugImplementation "com.facebook.flipper:flipper-network-plugin:$flipper_version"
    debugImplementation "com.facebook.flipper:flipper-leakcanary2-plugin:$flipper_version"
    debugImplementation 'com.facebook.soloader:soloader:0.10.4'
    
    // debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'

    // Include `flipperandroidnoop` and  `soloadernoop` individually
    releaseImplementation 'com.github.theGlenn.flipper-android-no-op:flipperandroidnoop:0.11.4'
    releaseImplementation 'com.github.theGlenn.flipper-android-no-op:soloadernoop:0.11.4'

    // Includes both libraries
    releaseImplementation 'com.github.theGlenn:flipper-android-no-op:0.11.4'
}

In your Application class same as this :

public class MyApplication extends Application {

  @Override public void onCreate() {
    super.onCreate();
    SoLoader.init(this, false);

    if (BuildConfig.DEBUG && FlipperUtils.shouldEnableFlipper(this)) {
      final FlipperClient client = AndroidFlipperClient.getInstance(this);
      client.addPlugin(NetworkFlipperPlugin())
      client.addPlugin(new InspectorFlipperPlugin(this, DescriptorMapping.withDefaults()));
      client.start();
    }
  }
}

About

No-op dependency for Flipper Android release mode

https://fbflipper.com/docs/getting-started/android-native

License:MIT License


Languages

Language:Kotlin 72.1%Language:Java 27.9%