title: What's the right way to add product flavors in react native?
body: <p>After i added product flavors in my react native project, the app always crashes when i made a release, right after i started it.</p>
  
  <p>I tried to open android studio to see Logcat, but since the app crashes in the moment it's started i couldn't see anything.</p>
  
  <p>Here is part of my app/build.gladle:</p>
  
  <pre><code>project.ext.envConfigFiles = [
      dev: ".env.local",
      production: ".env.production",
      staging: ".env.staging"
  ]
  
  apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
  
  android {
      flavorDimensions "default"
  
      defaultConfig {
          applicationId "com.company"
          applicationIdSuffix ""
          minSdkVersion rootProject.ext.minSdkVersion
          targetSdkVersion rootProject.ext.targetSdkVersion
          ndk {
              abiFilters "armeabi-v7a", "x86"
          }
          resValue "string", "build_config_package", "com.company"
      }
      buildTypes {
          release {
              minifyEnabled enableProguardInReleaseBuilds
              proguardFiles getDefaultProguardFile("proguard-android.txt"), 
              "proguard-rules.pro"
          }
      }
      productFlavors {
          dev {
              minSdkVersion rootProject.ext.minSdkVersion
              targetSdkVersion rootProject.ext.targetSdkVersion
              applicationIdSuffix ".dev"
              versionNameSuffix "-dev"
          }
          staging {
              minSdkVersion rootProject.ext.minSdkVersion
              targetSdkVersion rootProject.ext.targetSdkVersion
              applicationIdSuffix ".staging"
              versionNameSuffix "-staging"
          }
          production {
          }
      }
  }
  </code></pre>
  
  <p>I'm also using fastLane for deploy my app, like this:</p>
  
  <pre><code>lane :staging do |options|
  gradle(task: 'clean')
  gradle(
    task: "assemble",
    flavor: "Staging",
    build_type: "Release",
    print_command: false,
    properties: {
      "android.injected.signing.store.file" =&gt; "file.keystore",
      "android.injected.signing.store.password" =&gt; options[:storepass],
      "android.injected.signing.key.alias" =&gt; options[:keyalias],
      "android.injected.signing.key.password" =&gt; options[:keypass],
    }
  )
  upload_to_play_store(track: 'alpha')
  end
  </code></pre>