React Native: Native module AppStateModule tried to override AppStateModule for module name AppState
<p>I have a working iOS react native app ( react native v 0.38 ). I tried to run the same app in android as well.
<a href="https://i.stack.imgur.com/1JbFw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1JbFw.png" alt="enter image description here"></a>
I've manually linked all this libraries (which i'm using in iOS now) :</p>

<pre><code>react-native-camera
react-native-code-push
react-native-device-info
react-native-google-analytics-bridge
react-native-i18n
react-native-push-notification
react-native-restart
react-native-sqlite-storage
</code></pre>

<p>Settings.gradle :</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>include ':app'
include ':react-native-sqlite-storage'
project(':react-native-sqlite-storage').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sqlite-storage/src/android')
include ':react-native-restart'
project(':react-native-restart').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-restart/android')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/android')
include ':app', ':react-native-i18n'
project(':react-native-i18n').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-i18n/android')
include ':react-native-google-analytics-bridge', ':app'
project(':react-native-google-analytics-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-analytics-bridge/android')
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir,   '../node_modules/react-native-camera/android')</code></pre>
</div>
</div>
</p>

<p>build.gradle :</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}</code></pre>
</div>
</div>
</p>

<p>Android/app/build.gradle :</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>apply plugin: "com.android.application"

import com.android.build.OutputFile


apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

def enableSeparateBuildPerCPUArchitecture = false

def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.opencampus"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    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"
        }
    }
    // 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 {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile project(':react-native-sqlite-storage')
    compile project(':react-native-restart')
    compile project(':react-native-push-notification')
    compile ('com.google.android.gms:play-services-gcm:9.8.0') {
        force = true;
    }
    compile project(':react-native-i18n')
    compile project(':react-native-google-analytics-bridge')
    compile project(':react-native-device-info')
    compile project(':react-native-code-push')
    compile project(':react-native-camera')
}

task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}</code></pre>
</div>
</div>
</p>

<p>AndroidManifest :</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.opencampus"
    android:versionCode="1"
    android:versionName="1.0"&gt;

    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
    &lt;uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/&gt;
    &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
    &lt;uses-permission android:name="android.permission.BLUETOOTH"/&gt;
    &lt;permission
        android:name="${applicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature" /&gt;
    &lt;uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" /&gt;
    &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
    &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/&gt;

    &lt;uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="22" /&gt;

    &lt;application
      android:name=".MainApplication"
      android:allowBackup="true"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:theme="@style/AppTheme"&gt;
      &lt;activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:windowSoftInputMode="adjustResize"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"&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;receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
                &lt;category android:name="${applicationId}" /&gt;
            &lt;/intent-filter&gt;
        &lt;/receiver&gt;

        &lt;receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" /&gt;
        &lt;receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
            &lt;/intent-filter&gt;
        &lt;/receiver&gt;
        &lt;service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService"/&gt;
        &lt;service
            android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
            android:exported="false" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
            &lt;/intent-filter&gt;
        &lt;/service&gt;
    &lt;/application&gt;

&lt;/manifest&gt;</code></pre>
</div>
</div>
</p>

<p>MainApplication.java :</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>package com.opencampus;

import android.app.Application;
import android.util.Log;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;

import com.avishayil.rnrestart.ReactNativeRestartPackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.i18n.reactnativei18n.ReactNativeI18n;
import com.idehub.GoogleAnalyticsBridge.GoogleAnalyticsBridgePackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.microsoft.codepush.react.CodePush;
import com.lwansbrough.RCTCamera.RCTCameraPackage;
import org.pgsqlite.SQLitePluginPackage;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    protected boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    // 2. Override the getJSBundleFile method in order to let
    // the CodePush runtime determine where to get the JS
    // bundle location from on each app start
    @Override
    protected String getJSBundleFile() {
        return CodePush.getJSBundleFile();
    }

    @Override
    protected List&lt;ReactPackage&gt; getPackages() {
      return Arrays.&lt;ReactPackage&gt;asList(
          new MainReactPackage(),
          new SQLitePluginPackage(),
          new MainReactPackage(),
          new ReactNativePushNotificationPackage(),
          new ReactNativeI18n(),
          new GoogleAnalyticsBridgePackage(),
          new RNDeviceInfo(),
          new CodePush("-", MainApplication.this, BuildConfig.DEBUG),
          new RCTCameraPackage()
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}</code></pre>
</div>
</div>
</p>

<p>Any Solutions please?</p>