title: Creating Custom UI component for android on React Native fails. App crashes
body: <p>Since Facebook Login Button is available natively, I wanted a React Native wrapper component for Android. So, I tried writing it. But the app crashes even before the start.
  My github repository is:
  <a href="https://github.com/lalith26/react-native-fb-login-android" rel="noreferrer">https://github.com/lalith26/react-native-fb-login-android</a></p>
  
  <p>I have done the following:</p>
  
  <ol>
  <li>I created the Manager for the LoginButton facebook widget:</li>
  </ol>
  
  <p><a href="https://github.com/lalith26/react-native-fb-login-android/blob/master/android/app/src/main/java/com/fbloginbutton2/FBLoginButtonManager.java" rel="noreferrer">https://github.com/lalith26/react-native-fb-login-android/blob/master/android/app/src/main/java/com/fbloginbutton2/FBLoginButtonManager.java</a></p>
  
  <ol start="2">
  <li>I created a ReactPackage extending MainReactPackage:</li>
  </ol>
  
  <p><a href="https://github.com/lalith26/react-native-fb-login-android/blob/master/android/app/src/main/java/com/fbloginbutton2/FBLoginButtonReactPackage.java" rel="noreferrer">https://github.com/lalith26/react-native-fb-login-android/blob/master/android/app/src/main/java/com/fbloginbutton2/FBLoginButtonReactPackage.java</a></p>
  
  <ol start="3">
  <li>I added the new ReactPackage in MainActivity:</li>
  </ol>
  
  <p><a href="https://github.com/lalith26/react-native-fb-login-android/blob/master/android/app/src/main/java/com/fbloginbutton2/MainActivity.java#L29" rel="noreferrer">https://github.com/lalith26/react-native-fb-login-android/blob/master/android/app/src/main/java/com/fbloginbutton2/MainActivity.java#L29</a></p>
  
  <ol start="4">
  <li>I included the gradle dependency for facebook login sdk</li>
  </ol>
  
  <p><a href="https://github.com/lalith26/react-native-fb-login-android/blob/master/android/app/build.gradle#L28" rel="noreferrer">https://github.com/lalith26/react-native-fb-login-android/blob/master/android/app/build.gradle#L28</a></p>
  
  <ol start="5">
  <li>I made the JS component wrapping the Native Component:</li>
  </ol>
  
  <p><a href="https://github.com/lalith26/react-native-fb-login-android/blob/master/fblogin.js" rel="noreferrer">https://github.com/lalith26/react-native-fb-login-android/blob/master/fblogin.js</a></p>
  
  <ol start="6">
  <li>Finally I used the JS component:</li>
  </ol>
  
  <p><a href="https://github.com/lalith26/react-native-fb-login-android/blob/master/index.android.js#L21" rel="noreferrer">https://github.com/lalith26/react-native-fb-login-android/blob/master/index.android.js#L21</a></p>
  
  <p>I read through the web and found that propTypes are mandatory to be passed. I tried that too. But the app crashes on start itself. I am not able to see any logs. So, I am not able to find the actual reason for the issue.
  I tried the same set of steps for a button and it worked fine. </p>
  
  <p>Is there something I am simply doing wrong. Please help..</p>
  
  <p>I got access to the logs of the emulator through logcat. It shows:</p>
  
  <blockquote>
    <p>E/AndroidRuntime( 2550): Process: com.fbloginbutton2, PID: 2550
    E/AndroidRuntime( 2550): java.lang.ExceptionInInitializerError
    E/AndroidRuntime( 2550):  at
    com.fbloginbutton2.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:29)
    E/AndroidRuntime( 2550):  at
    com.fbloginbutton2.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:15)
    E/AndroidRuntime( 2550):  at
    com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:41)
    E/AndroidRuntime( 2550):  at
    com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:172)
    E/AndroidRuntime( 2550):  at
    com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:137)
    E/AndroidRuntime( 2550):  at
    com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:574)
    E/AndroidRuntime( 2550):  at
    com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:622)
    E/AndroidRuntime( 2550):  at
    com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
    E/AndroidRuntime( 2550):  at
    com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:114)
    E/AndroidRuntime( 2550):  at
    android.view.Choreographer$CallbackRecord.run(Choreographer.java:765)
    E/AndroidRuntime( 2550):  at
    android.view.Choreographer.doCallbacks(Choreographer.java:580)
    E/AndroidRuntime( 2550):  at
    android.view.Choreographer.doFrame(Choreographer.java:549)
    E/AndroidRuntime( 2550):  at
    android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
    E/AndroidRuntime( 2550):  at
    android.os.Handler.handleCallback(Handler.java:739) E/AndroidRuntime(
    2550):    at android.os.Handler.dispatchMessage(Handler.java:95)
    E/AndroidRuntime( 2550):  at android.os.Looper.loop(Looper.java:135)
    E/AndroidRuntime( 2550):  at
    android.app.ActivityThread.main(ActivityThread.java:5221)
    E/AndroidRuntime( 2550):  at java.lang.reflect.Method.invoke(Native
    Method) E/AndroidRuntime( 2550):  at
    java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(
    2550):    at
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    E/AndroidRuntime( 2550):  at
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
    E/AndroidRuntime( 2550): Caused by: null E/AndroidRuntime( 2550):     at
    com.facebook.internal.Validate.sdkInitialized(Validate.java:99)
    E/AndroidRuntime( 2550):  at
    com.facebook.FacebookSdk.getCallbackRequestCodeOffset(FacebookSdk.java:735)
    E/AndroidRuntime( 2550):  at
    com.facebook.internal.CallbackManagerImpl$RequestCodeOffset.toRequestCode(CallbackManagerImpl.java:109)
    E/AndroidRuntime( 2550):  at
    com.facebook.login.widget.LoginButton.(LoginButton.java:58)
    E/AndroidRuntime( 2550):  ... 21 more W/ActivityManager( 1327):<br>
    Force finishing activity com.fbloginbutton2/.MainActivity
    E/EGL_emulation( 1373): tid 1373: eglCreateSyncKHR(1181): error 0x3004
    (EGL_BAD_ATTRIBUTE)</p>
  </blockquote>