title: react native - imposible to remove a library for android
body: <p>Okey, i am on day 3 for this issue. I think i have tried nearly everything.</p>
  
  <p>The package which i can't remove: <code>react-native-firebase</code></p>
  
  <p>I tried:
  Completely removing all references with firebase in the code, which include build.gradle files, package.json, etc.
  Checking out to older commits and making a build( The firebase is still there!!! ).
  Tried cleaning the project with <code>./gradlew clean</code>.
  I have removed <code>node_modules</code> and reinstalled multiple times.
  Cleaned watchdog caches.</p>
  
  <p>Previously i was able to build the apk(but it would crash instantly when opened on android). Right now, i can't even make a apk..
  I get error: </p>
  
  <pre><code>/android/app/src/main/AndroidManifest.xml:9:5-81 Warning:
          Element uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:9:5-81 duplicated with element declared at AndroidManifest.xml:5:5-81
  :app:processReleaseResources
  :app:generateReleaseSources
  :app:incrementalReleaseJavaCompilationSafeguard
  :app:compileReleaseJavaWithJavac
  :app:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
  :app:compileReleaseNdk UP-TO-DATE
  :app:compileReleaseSources
  :app:lintVitalRelease
  :app:transformClassesWithJarMergingForRelease FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
  &gt; com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzbyb.class
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  
  Total time: 56.222 secs
  </code></pre>
  
  <p>Any help or advice would be really helpful.</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong>: After removing duplicate permissions and running <code>./gradlew clean</code>, rebuilding and reassembling. Same error:</p>
  
  <pre><code>:app:incrementalReleaseJavaCompilationSafeguard
  :app:compileReleaseJavaWithJavac
  :app:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
  :app:compileReleaseNdk UP-TO-DATE
  :app:compileReleaseSources
  :app:lintVitalRelease
  :app:transformClassesWithJarMergingForRelease FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
  &gt; com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzbyb.class
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  
  Total time: 1 mins 11.648 secs
  </code></pre>
  
  <p><strong>EDIT</strong>:</p>
  
  <pre><code>dependencies {
      compile project(':react-native-flurry-analytics')
      compile project(':react-native-fetch-blob')
      compile project(':react-native-permissions')
      compile project(':react-native-animation')
      compile project(':react-native-mail')
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support:appcompat-v7:25.0.0'
      compile 'com.facebook.react:react-native:+'
      compile 'com.google.android.gms:play-services:10.2.1'
      compile 'com.google.android.gms:play-services-location:10.2.1'
      compile 'com.google.android.gms:play-services-gcm:10.2.1'
      compile project(':react-native-share')
      compile project(':react-native-maps')
      compile project(':react-native-onesignal')
  }
  </code></pre>
  
  <p><strong>EDIT</strong>:</p>
  
  <pre><code>08-30 15:30:08.871 1090-1153/com.adpages.android E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
                                                                     java.lang.RuntimeException: An error occured while executing doInBackground()
                                                                         at android.os.AsyncTask$3.done(AsyncTask.java:299)
                                                                         at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
                                                                         at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
                                                                         at java.util.concurrent.FutureTask.run(FutureTask.java:239)
                                                                         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
                                                                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
                                                                         at java.lang.Thread.run(Thread.java:856)
                                                                      Caused by: java.lang.NoClassDefFoundError: com.google.android.gms.maps.GoogleMapOptions
                                                                         at com.airbnb.android.react.maps.AirMapManager.&lt;init&gt;(AirMapManager.java:52)
                                                                         at com.airbnb.android.react.maps.MapsPackage.createViewManagers(MapsPackage.java:39)
                                                                         at com.facebook.react.XReactInstanceManagerImpl.createAllViewManagers(XReactInstanceManagerImpl.java:699)
                                                                         at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:204)
                                                                         at com.facebook.react.CoreModulesPackage.access$200(CoreModulesPackage.java:69)
                                                                         at com.facebook.react.CoreModulesPackage$8.get(CoreModulesPackage.java:143)
                                                                         at com.facebook.react.CoreModulesPackage$8.get(CoreModulesPackage.java:140)
                                                                         at com.facebook.react.LazyReactPackage.createNativeModules(LazyReactPackage.java:76)
                                                                         at com.facebook.react.XReactInstanceManagerImpl.processPackage(XReactInstanceManagerImpl.java:954)
                                                                         at com.facebook.react.XReactInstanceManagerImpl.createReactContext(XReactInstanceManagerImpl.java:862)
                                                                         at com.facebook.react.XReactInstanceManagerImpl.access$600(XReactInstanceManagerImpl.java:110)
                                                                         at com.facebook.react.XReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(XReactInstanceManagerImpl.java:214)
                                                                         at com.facebook.react.XReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(XReactInstanceManagerImpl.java:193)
                                                                         at android.os.AsyncTask$2.call(AsyncTask.java:287)
                                                                         at java.util.concurrent.FutureTask.run(FutureTask.java:234)
                                                                         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
                                                                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
                                                                         at java.lang.Thread.run(Thread.java:856) 
  08-30 15:30:08.891 1090-1090/com.adpages.android D/libEGL: loaded /system/lib/egl/libEGL_genymotion.so
  </code></pre>
  
  <p><strong>EDIT</strong>:</p>
  
  <pre><code>dependencies {
      compile project(':react-native-flurry-analytics')
      compile project(':react-native-fetch-blob')
      compile project(':react-native-permissions')
      compile project(':react-native-animation')
      compile project(':react-native-mail')
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support:appcompat-v7:25.0.0'
      compile 'com.facebook.react:react-native:+'
      compile project(':react-native-share')
      compile project(':react-native-onesignal')
  
      compile(project(':react-native-maps')) {
        exclude group: 'com.google.android.gms', module: 'play-services'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
        exclude group: 'com.google.android.gms', module: 'play-services-location'
        exclude group: 'com.google.android.gms', module: 'play-services-gcm'
      }
      compile 'com.google.android.gms:play-services:10.2.1'
      compile 'com.google.android.gms:play-services-location:10.2.1'
      // Required for OneSignal, even if you have added FCM.
      compile 'com.google.android.gms:play-services-gcm:10.2.1'
  }
  </code></pre>