title: What does it mean next error: 'Program type already present'
body: <p>Currently have issue with building react-native project After buildin I got next error in my console: </p>
  
  <blockquote>
    <p>Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
    D8: Program type already present: android.support.v4.app.LoaderManager$LoaderCallbacks</p>
  </blockquote>
  
  <p>FAILURE: Build failed with an exception.</p>
  
  <blockquote>
    <ul>
    <li>What went wrong:
    Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
    com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives</li>
    </ul>
  </blockquote>
  
  <p>android/build.gradle</p>
  
  <pre><code> buildscript {
          ext {
              buildToolsVersion = "28"
              minSdkVersion = 16
              compileSdkVersion = 28
              targetSdkVersion = 26
              supportLibVersion = "27.1.1"
          }
          repositories {
              google()
              jcenter()
          }
          dependencies {
              classpath 'com.android.tools.build:gradle:3.2.1'
              classpath 'com.google.gms:google-services:4.0.1'
          }
      }
  
      allprojects {
          repositories {
              mavenLocal()
              google()
              jcenter()
              maven {
                  // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                  url "$rootDir/../node_modules/react-native/android"
              }
          }
      }
  
  app/build.gradle
  
  apply plugin: "com.android.application"
  
  import com.android.build.OutputFile
  
  def enableProguardInReleaseBuilds = false
  
  android {
      compileSdkVersion 28
      buildToolsVersion "28"
  
      defaultConfig {
          applicationId "com.hypaship"
          minSdkVersion rootProject.ext.minSdkVersion
          targetSdkVersion rootProject.ext.targetSdkVersion
          versionCode 1
          versionName "1.0"
          ndk {
              abiFilters "armeabi-v7a", "x86"
          }
      }
      signingConfigs {
          release {
              if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                  storeFile file(MYAPP_RELEASE_STORE_FILE)
                  storePassword MYAPP_RELEASE_STORE_PASSWORD
                  keyAlias MYAPP_RELEASE_KEY_ALIAS
                  keyPassword MYAPP_RELEASE_KEY_PASSWORD
              }
          }
      }
      subprojects {
        project.configurations.all {
            afterEvaluate {project -&gt;
              if (project.hasProperty("android")) {
                  android {
                      compileSdkVersion 26
                      buildToolsVersion '26.0.2'
                  }
              }
          }
           resolutionStrategy.eachDependency { details -&gt;
              if (details.requested.group == 'com.android.support'
                    &amp;&amp; !details.requested.name.contains('multidex') ) {
                 details.useVersion "26.0.2"
              }
           }
        }
      }
  
      splits {
          abi {
              reset()
              enable enableSeparateBuildPerCPUArchitecture
              universalApk false  // If true, also generate a universal APK
              include "armeabi-v7a", "x86"
          }
      }
      buildTypes {
          release {
              minifyEnabled enableProguardInReleaseBuilds
              proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
              signingConfig signingConfigs.release
          }
      }
      // 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:
              // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
              def versionCodes = ["armeabi-v7a":1, "x86":2]
              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 {
      implementation project(':react-native-fcm')
      implementation project(':react-native-firebase')
      implementation project(':react-native-device-info')
      implementation project(':react-native-geocoder')
      implementation fileTree(dir: "libs", include: ["*.jar"])
      implementation "com.facebook.react:react-native:+"
      implementation project(':react-native-maps')
      implementation project(':react-native-navigation')
  
      implementation 'com.android.support:appcompat-v7:26.0.1'
  
      implementation "com.google.android.gms:play-services-base:16.0.1"
  
      implementation 'com.google.firebase:firebase-core'
      implementation 'com.google.firebase:firebase-messaging'
  }
  
  // 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 plugin: 'com.google.gms.google-services'
  com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
  </code></pre>
  
  <p>MainApplication.java</p>
  
  <pre><code>package com.hypaship;
  
  import android.app.Application;
  
  import com.facebook.react.ReactNativeHost;
  import com.facebook.react.ReactPackage;
  import com.facebook.react.shell.MainReactPackage;
  import com.facebook.soloader.SoLoader;
  import io.invertase.firebase.RNFirebasePackage;
  import com.devfd.RNGeocoder.RNGeocoderPackage;
  import com.airbnb.android.react.maps.MapsPackage;
  import com.evollu.react.fcm.FIRMessagingPackage;
  import com.learnium.RNDeviceInfo.RNDeviceInfo;
  
  import com.reactnativenavigation.NavigationApplication;
  
  import java.util.Arrays;
  import java.util.List;
  
  public class MainApplication extends NavigationApplication {
  
    private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
      @Override
      public boolean getUseDeveloperSupport() {
        return BuildConfig.DEBUG;
      }
  
      @Override
      protected List&lt;ReactPackage&gt; getPackages() {
           // Add additional packages you require here
           // No need to add RnnPackage and MainReactPackage
           return Arrays.&lt;ReactPackage&gt;asList(
              new MainReactPackage(),
              new FIRMessagingPackage(),
              new RNFirebasePackage(),
              new RNDeviceInfo(),
              new RNGeocoderPackage(),
              new MapsPackage()
        );
      }
  
      @Override
      protected String getJSMainModuleName() {
        return "index";
      }
    };
  
    @Override
    public ReactNativeHost getReactNativeHost() {
      return mReactNativeHost;
    }
  
    @Override
    public void onCreate() {
      super.onCreate();
      SoLoader.init(this, /* native exopackage */ false);
    }
  
    @Override
     public boolean isDebug() {
         // Make sure you are using BuildConfig from your own application
         return BuildConfig.DEBUG;
     }
     @Override
      public List&lt;ReactPackage&gt; createAdditionalReactPackages() {
          return null;
      }
  
      @Override
      public String getJSMainModuleName() {
          return "index";
      }
  }
  </code></pre>
  
  <p>Appreciate any help! Thanks in advance!</p>