title: gradlew assembleRelease doesn't work with react-native-camera
body: <p>I can't build release version of application. When I write <code>.\gradlew assembleRelease</code>, I get this error <code>Execution failed for task ':react-native-camera:compileGeneralReleaseJavaWithJavac'</code>. My <code>app/build.gradle</code> file:</p>
  <pre class="lang-js prettyprint-override"><code>apply plugin: &quot;com.android.application&quot;
  apply from: &quot;../../node_modules/react-native-vector-icons/fonts.gradle&quot;
  
  import com.android.build.OutputFile
  
  project.ext.react = [
      entryFile: &quot;index.js&quot;,
      enableHermes: false,  // clean and rebuild if changing
  ]
  
  apply from: &quot;../../node_modules/react-native/react.gradle&quot;
  
  def enableSeparateBuildPerCPUArchitecture = false
  
  def enableProguardInReleaseBuilds = false
  
  def jscFlavor = 'org.webkit:android-jsc:+'
  
  def enableHermes = project.ext.react.get(&quot;enableHermes&quot;, false);
  
  android {
      compileSdkVersion rootProject.ext.compileSdkVersion
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      defaultConfig {
          applicationId &quot;com.ms.showcase&quot;
          minSdkVersion rootProject.ext.minSdkVersion
          targetSdkVersion rootProject.ext.targetSdkVersion
          versionCode 200
          versionName &quot;2.0.0&quot;
          multiDexEnabled true
          missingDimensionStrategy &quot;react-native-camera&quot;, &quot;general&quot;
      }
      splits {
          abi {
              reset()
              enable enableSeparateBuildPerCPUArchitecture
              universalApk false  // If true, also generate a universal APK
              include &quot;armeabi-v7a&quot;, &quot;x86&quot;, &quot;arm64-v8a&quot;, &quot;x86_64&quot;
          }
      }
      signingConfigs {
          debug {
              storeFile file('debug.keystore')
              storePassword 'android'
              keyAlias 'androiddebugkey'
              keyPassword 'android'
          }
      }
      buildTypes {
          debug {
              signingConfig signingConfigs.debug
          }
          release {
              // Caution! In production, you need to generate your own keystore file.
              // see https://facebook.github.io/react-native/docs/signed-apk-android.
              signingConfig signingConfigs.debug
              minifyEnabled enableProguardInReleaseBuilds
              proguardFiles getDefaultProguardFile(&quot;proguard-android.txt&quot;), &quot;proguard-rules.pro&quot;
          }
      }
      // applicationVariants are e.g. debug, release
      applicationVariants.all { variant -&gt;
          variant.outputs.each { output -&gt;
              // For each separate APK per architecture, set a unique version code as described here:
              // https://developer.android.com/studio/build/configure-apk-splits.html
              def versionCodes = [&quot;armeabi-v7a&quot;: 1, &quot;x86&quot;: 2, &quot;arm64-v8a&quot;: 3, &quot;x86_64&quot;: 4]
              def abi = output.getFilter(OutputFile.ABI)
              if (abi != null) {  // null for the universal-debug, universal-release variants
                  output.versionCodeOverride =
                          versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
              }
  
          }
      }
  }
  
  dependencies {
      // This should be here already
  
      // Firebase dependencies
      implementation &quot;com.google.android.gms:play-services-base:16.1.0&quot;
      implementation &quot;com.google.firebase:firebase-core:16.0.9&quot;
      implementation &quot;com.google.firebase:firebase-messaging:19.0.0&quot;
      implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
  
      implementation fileTree(dir: &quot;libs&quot;, include: [&quot;*.jar&quot;])
      implementation &quot;com.facebook.react:react-native:+&quot;  // From node_modules
      implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
      implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
  
      if (enableHermes) {
          def hermesPath = &quot;../../node_modules/hermes-engine/android/&quot;;
          debugImplementation files(hermesPath + &quot;hermes-debug.aar&quot;)
          releaseImplementation files(hermesPath + &quot;hermes-release.aar&quot;)
      } else {
          implementation jscFlavor
      }
  }
  
  // Run this once to be able to run the application with BUCK
  // puts all compile dependencies into folder libs for BUCK to use
  task copyDownloadableDepsToLibs(type: Copy) {
      from configurations.compile
      into 'libs'
  }
  
  apply from: file(&quot;../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle&quot;); applyNativeModulesAppBuildGradle(project)
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  <p>I tried to search in Google, but I found nothing. My RN version 0.61. I know that it can be a problem with AndroidX, and downgrade to RN 0.59 can help, but I think, that it's not a good idea.</p>
  <p>How can I fix this this problem?</p>