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.

on 0.62.2 gradlew assembleRelease fails on Flipper dependency

See original GitHub issue

After upgrading to ./gradlew clean debugRelease works and build is successful, but assembleRelease fails with error on importing Flipper method on ReactNativeFlipper.java

if debugImplementation in app/build.gradle are changed to implementation, build is done successfully. But I don’t think it’s right approach to include Flipper in release version.

//         debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
        implementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
          exclude group:'com.facebook.fbjni'
        }

//         debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        implementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
            exclude group:'com.facebook.flipper'
        }

//         debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        implementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
            exclude group:'com.facebook.flipper'
        }


React Native version:

info Fetching system and libraries information...
System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
    Memory: 58.43 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 13.3.0 - /usr/local/Cellar/node/13.3.0_1/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/Cellar/node/13.3.0_1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 21, 22, 23, 24, 25, 26, 27, 28, 29
      Build Tools: 26.0.2, 27.0.3, 28.0.3, 29.0.0, 29.0.0, 29.0.2, 30.0.0
      System Images: android-21 | Google APIs Intel x86 Atom_64, android-22 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom_64, android-24 | Google Play Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom_64, android-25 | Google Play Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-Q | Google Play Intel x86 Atom
      Android NDK: 20.1.5948944
  IDEs:
    Android Studio: Not Found
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_201 - /usr/bin/javac
    Python: 2.7.17 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Upgrade to 0.62.2 as described in this tool https://react-native-community.github.io/upgrade-helper/?from=0.59.9&to=0.62.2

  1. ./gradlew clean assembleDebug

Expected Results

See the BUILD SUCCESSFUL message

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

26reactions
13thdeuscommented, Apr 27, 2020

I have found wokraround. app level build gradle:

    ...
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"

            signingConfig signingConfigs.release

            sourceSets {
                main {
                    java {
                        exclude 'com/{path_to_file}/ReactNativeFlipper.java'
                    }
                }
            }
        }
    }
    ...

MainApplication.java

    ...
    @Override
    public void onCreate() {
        super.onCreate();
        SoLoader.init(this, /* native exopackage */ false);
        if (BuildConfig.DEBUG) {
            initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
        }
    }
    ...
2reactions
schiecommented, Apr 30, 2020

@13thdeus you are my hero of the day

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-Native assembleRelease fails for task
Now I'm running ./gradlew assembleRelease --info from the terminal instead of Android Studio and I get different error. Here is the result: > ......
Read more >
deprecated gradle features were used in this build react ...
gradlew assembleRelease , I get the warning. Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. On running...
Read more >
React Native Gradlew Assemblerelease Failed To Execute ...
Ask questionson 0.62.2 gradlew assembleRelease fails on Flipper dependency Upgrade to 0.62.2 as described in this tool https://reactnativecommunity.
Read more >
Using Hermes
Hermes is an open-source JavaScript engine optimized for React Native. For many apps, using Hermes will result in improved start-up time, ...
Read more >
apptailor
Hi, I updated my RN and now google sign-in is not working and returning the delightfully opaque DEVELOPER ERROR. It works fine on...
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