title: Adding facebook SDK to react-native project
body: <p>I am trying to add facebook sdk in my react-native project using this link - 
  <a href="https://developers.facebook.com/docs/react-native/getting-started-android" rel="nofollow">https://developers.facebook.com/docs/react-native/getting-started-android</a></p>
  
  <p>But, rnpm was not adding the SDK automatically as described in the link.
  So, I manually added react-native-fbsdk using this link - <a href="https://github.com/facebook/react-native-fbsdk/issues/205" rel="nofollow">https://github.com/facebook/react-native-fbsdk/issues/205</a></p>
  
  <p>Then, I build my project and generate release and debug apk.
  But, now the android app is crashing at the launch time.
  And, there is no way to find out why this is happening.</p>
  
  <p>Here is the code-</p>
  
  <p>MainActivity.java
  <div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>package com.netizen_hybrid;
  
  
  import android.content.Intent;
  
  import com.facebook.react.ReactActivity;
  import com.facebook.react.ReactPackage;
  import com.facebook.react.shell.MainReactPackage;
  
  import com.facebook.FacebookSdk;
  import com.facebook.CallbackManager;
  import com.facebook.reactnative.androidsdk.FBSDKPackage;
  
  import java.util.Arrays;
  import java.util.List;
  
  public class MainActivity extends ReactActivity {
      CallbackManager mCallbackManager;
      /**
       * Returns the name of the main component registered from JavaScript.
       * This is used to schedule rendering of the component.
       */
      
      @Override
      protected String getMainComponentName() {
          return "Netizen_Hybrid";
      }
  
      /**
       * Returns whether dev mode should be enabled.
       * This enables e.g. the dev menu.
       */
      @Override
      protected boolean getUseDeveloperSupport() {
          return BuildConfig.DEBUG;
      }
  
      /**
       * A list of packages used by the app. If the app uses additional views
       * or modules besides the default ones, add more packages here.
       */
      @Override
      protected List&lt;ReactPackage&gt; getPackages() {
          mCallbackManager = new CallbackManager.Factory().create();
          ReactPackage packages[] = new ReactPackage[]{
             new MainReactPackage(),
             new FBSDKPackage(mCallbackManager),
          };
          return Arrays.&lt;ReactPackage&gt;asList(packages);
      }
      
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
         mCallbackManager.onActivityResult(requestCode, resultCode, data);
      }
      
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>build.gradle - </p>
  
  <pre><code>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 'com.facebook.android:facebook-android-sdk:4.+'
  compile project(":react-native-fbsdk")
  </code></pre>
  
  <p>}</p>
  
  <p>settings.gradle - </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>rootProject.name = 'Netizen_Hybrid'
  
  include ':app'
  
  include ':react-native-fbsdk'
  project(':react-native-fbsdk').projectDir = new File(settingsDir, '../node_modules/react-native-fbsdk/Android')</code></pre>
  </div>
  </div>
  </p>
  
  <p>AndroidManifest.xml</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <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.netizen_hybrid"
      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.ACCESS_FINE_LOCATION" /&gt;
  
      &lt;uses-sdk
          android:minSdkVersion="16"
          android:targetSdkVersion="22" /&gt;
  
      &lt;application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:theme="@style/AppTheme"
        android:name="com.netizen_hybrid.MyApplication"
        &gt;
        
        &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name"
          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.FacebookActivity"
            android:configChanges=
                   "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:label="@string/app_name" /&gt;
        &lt;meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/&gt;
        &lt;provider android:authorities="com.facebook.app.FacebookContentProvider142933766117579"
            android:name="com.facebook.FacebookContentProvider"
            android:exported="true" /&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>MyApplication.java - </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import android.app.Application;
  import com.facebook.FacebookSdk;
  import com.facebook.appevents.AppEventsLogger;
  
  public class MyApplication extends Application {
      @Override
      public void onCreate() {
          super.onCreate();
          // Initialize the SDK before executing any other operations,
          FacebookSdk.sdkInitialize(getApplicationContext());
          AppEventsLogger.activateApp(this);
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can Anybody tell where I am doing wrong ?
  Thanks in advance.</p>