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.

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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bizzguycommented, Jun 12, 2020

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

0reactions
niall8zcommented, Dec 21, 2020

@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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Course registration: What is a scheduling conflict? - Sciences Po
A "scheduling conflict" or a "time conflict" occurs when two classes overlap making it impossible to register for both. If you try to...
Read more >
Understanding your schedule | MIT Registrar
For conflicts with HASS classes ā€” we recommend adjusting the conflicting class with an alternative lecture or recitation section, if possible. Otherwise, youĀ ......
Read more >
Class time conflict | Twin Cities One Stop Student Services
Complete the class time conflict approval form if your classes overlap. ... If you enroll in classes with conflicting final exam times, find...
Read more >
Registration Errors - Office of the Registrar - UC Merced
Time Conflict. The error is occurring because you have tried to register for two courses scheduled at the same time or the final...
Read more >
Common Registration Issues | Oklahoma State University
Time Conflict; Maximum Hours Exceeded; Repeat hours Exceeded; Student's last class cannot be dropped; Connected Course Drop Confirmation; Degree RestrictionĀ ...
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