flipper-noop conflicting classes at release
See original GitHub issueš Bug Report
Both com.facebook.flipper:flipper
and com.facebook.flipper:flipper-noop
are both being included in releases when I follow the flipper websiteās documentation.
To Reproduce
Per the websiteās documentation (https://fbflipper.com/docs/getting-started/android-native#dependencies), weāre supposed to set up our dependencies like this:
dependencies {
debugImplementation 'com.facebook.flipper:flipper:0.46.0'
debugImplementation 'com.facebook.soloader:soloader:0.9.0'
releaseImplementation 'com.facebook.flipper:flipper-noop:0.46.0'
}
in my project iām doing this:
debugImplementation 'com.facebook.soloader:soloader:0.9.0'
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group: 'com.facebook.fbjni', module: 'fbjni'
}
releaseImplementation "com.facebook.flipper:flipper-noop:${FLIPPER_VERSION}"
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
my FLIPPER_VERSION is currently 0.46.0
However, when I go to make a release build of my app, the following gradle task fails (Note: my app is called āDriverā):
> Task :app:checkDriverReleaseDuplicateClasses FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDriverReleaseDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class com.facebook.flipper.BuildConfig found in modules flipper-0.46.0-runtime.jar (com.facebook.flipper:flipper:0.46.0) and flipper-noop-0.46.0-runtime.jar (com.facebook.flipper:flipper-noop:0.46.0)
Duplicate class com.facebook.flipper.android.AndroidFlipperClient found in modules flipper-0.46.0-runtime.jar (com.facebook.flipper:flipper:0.46.0) and flipper-noop-0.46.0-runtime.jar (com.facebook.flipper:flipper-noop:0.46.0)
Duplicate class com.facebook.flipper.android.diagnostics.FlipperDiagnosticActivity found in modules flipper-0.46.0-runtime.jar (com.facebook.flipper:flipper:0.46.0) and flipper-noop-0.46.0-runtime.jar (com.facebook.flipper:flipper-noop:0.46.0)
Duplicate class com.facebook.flipper.core.FlipperClient found in modules flipper-0.46.0-runtime.jar (com.facebook.flipper:flipper:0.46.0) and flipper-noop-0.46.0-runtime.jar (com.facebook.flipper:flipper-noop:0.46.0)
Duplicate class com.facebook.flipper.core.FlipperPlugin found in modules flipper-0.46.0-runtime.jar (com.facebook.flipper:flipper:0.46.0) and flipper-noop-0.46.0-runtime.jar (com.facebook.flipper:flipper-noop:0.46.0)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
So it would appear that com.facebook.flipper:flipper
and com.facebook.flipper:flipper-noop
are both being included somehow.
Iāve attempted to google around and try some different strategies (following that android help link, copying how others are configuring flipper in their RN projects, etc.), but none have been successful.
My workaround has been to install flipper like this:
debugImplementation 'com.facebook.soloader:soloader:0.9.0'
implementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group: 'com.facebook.fbjni', module: 'fbjni'
}
// releaseImplementation "com.facebook.flipper:flipper-noop:${FLIPPER_VERSION}"
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
So com.facebook.flipper:flipper
is no longer debugImplementation, and com.facebook.flipper:flipper-noop
is removed entirely.
Iām wondering if its safe to release something like this? Are there performance considerations of including flipper instead of flipper-noop in my release or will the impact purely be my APK being a little bigger than it needs to be?
Environment
ld@monster:~$ uname -a
Linux monster 4.15.0-106-generic #107-Ubuntu SMP Thu Jun 4 11:27:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Iāve reproād this with versions of flipper from 0.44 up to the latest.
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Iām not seeing this problem in my app. My release builds only include flipper-noop and donāt have a compile problem. Iām using 0.46.0 as well. I suspect it is something in your gradle setup and not a problem with Flipper.
Does your app contain any additional modules that might be including Flipper?
Also, you could use the gradle ādependenciesā command to see which libraries are being included in the various builds:
https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html
@passy - which we have done, implementing an āinitialiserā containing all Flipper-related dependencies for our dev or staging flavours, which is left completely empty for production or release. If that is the case, and these things are empty for release versions (which also configured for no-op) how can it be that we run into duplicate class issues?