title: React Native: Override Error on Package without Duplicate
body: <p>I'm trying to use the react-native-camera package but when I added this to my project, I wasn't able to see the camera, instead it was loading and a warning. Then I search on the internet for this warning and saw that I had to link this library manually and so I did. But when I try to build I got this:</p>
  
  <p><a href="https://i.stack.imgur.com/qbX8I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qbX8I.png" alt="error"></a></p>
  
  <p>Here is my MainApplication.java</p>
  
  <pre><code>import android.app.Application;
  import android.content.Context;
  import com.facebook.react.PackageList;
  import com.facebook.react.ReactApplication;
  import com.facebook.react.ReactNativeHost;
  import com.facebook.react.ReactPackage;
  import com.facebook.soloader.SoLoader;
  import java.lang.reflect.InvocationTargetException;
  import java.util.List;
  import org.reactnative.camera.RNCameraPackage;
  
  public class MainApplication extends Application implements ReactApplication {
  
    private final ReactNativeHost mReactNativeHost =
        new ReactNativeHost(this) {
          @Override
          public boolean getUseDeveloperSupport() {
            return BuildConfig.DEBUG;
          }
  
          public boolean canOverrideExistingModule() {        
            return true;    
          }   
  
          @Override
          protected List&lt;ReactPackage&gt; getPackages() {
            @SuppressWarnings("UnnecessaryLocalVariable")
            List&lt;ReactPackage&gt; packages = new PackageList(this).getPackages();
            packages.add(new RNCameraPackage());
            return packages;
          }
  
          @Override
          protected String getJSMainModuleName() {
            return "index";
          }
        };
  
    @Override
    public ReactNativeHost getReactNativeHost() {
      return mReactNativeHost;
    }
  
    @Override
    public void onCreate() {
      super.onCreate();
      SoLoader.init(this, /* native exopackage */ false);
      initializeFlipper(this); // Remove this line if you don't want Flipper enabled
    }
  
    /**
     * Loads Flipper in React Native templates.
     *
     * @param context
     */
    private static void initializeFlipper(Context context) {
      if (BuildConfig.DEBUG) {
        try {
          /*
           We use reflection here to pick up the class that initializes Flipper,
          since Flipper library is not available in release mode
          */
          Class&lt;?&gt; aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
          aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
        } catch (ClassNotFoundException e) {
          e.printStackTrace();
        } catch (NoSuchMethodException e) {
          e.printStackTrace();
        } catch (IllegalAccessException e) {
          e.printStackTrace();
        } catch (InvocationTargetException e) {
          e.printStackTrace();
        }
      }
    }
  }
  </code></pre>
  
  <p>Android Manifest</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.app"&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.VIBRATE"/&gt;
      &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
      &lt;uses-permission android:name="android.permission.RECORD_AUDIO"/&gt;
      &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  
      &lt;application
        android:name=".MainApplication"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:allowBackup="false"
        android:theme="@style/AppTheme"&gt;
        &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name"
          android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
          android:windowSoftInputMode="adjustResize"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Getting this when trying to access the camera:</p>
  
  <pre><code>Possible Unhandled Promise Rejection (id: 0):
  TypeError: CameraManager.checkVideoAuthorizationStatus is not a function
  TypeError: CameraManager.checkVideoAuthorizationStatus is not a function
      at requestPermissions$ (http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:129653:61)
      at tryCatch (http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:25682:19)
      at Generator.invoke [as _invoke] (http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:25857:24)
      at Generator.prototype.&lt;computed&gt; [as next] (http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:25725:23)
      at tryCatch (http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:25682:19)
      at invoke (http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:25758:22)
      at http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:25788:13
      at tryCallTwo (http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:27046:7)
      at doResolve (http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:27210:15)
      at new Promise (http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false:27069:5)
  </code></pre>