title: Facebook login button on Android causing ExceptionInInitializerError
body: <p>I am using Facebook's Android SDK. If I add Facebook's LoginButton to my xml layout. I receive a runtime error: <code>ExceptionInInitializerError</code>.</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
  android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"&gt;
  
  &lt;com.facebook.login.widget.LoginButton
      android:id="@+id/login_button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center_horizontal"
      android:layout_marginTop="30dp"
      android:layout_marginBottom="30dp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>My MainActivity:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.activity_main);
  
      FacebookSdk.sdkInitialize(getApplicationContext());
  }
  </code></pre>
  
  <p>Here is the stack trace:</p>
  
  <pre><code>java.lang.ExceptionInInitializerError
              at java.lang.reflect.Constructor.newInstance(Native Method)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
              at android.view.LayoutInflater.createView(LayoutInflater.java:607)
              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
              at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
              at android.app.Activity.setContentView(Activity.java:2145)
              at com.dupls.wedding.MainActivity.onCreate(MainActivity.java:25)
              at android.app.Activity.performCreate(Activity.java:5990)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
              at android.app.ActivityThread.access$800(ActivityThread.java:151)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5254)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
       Caused by: null
              at com.facebook.internal.Validate.sdkInitialized(Validate.java:99)
              at com.facebook.FacebookSdk.getCallbackRequestCodeOffset(FacebookSdk.java:735)
              at com.facebook.internal.CallbackManagerImpl$RequestCodeOffset.toRequestCode(CallbackManagerImpl.java:109)
              at com.facebook.login.widget.LoginButton.&lt;clinit&gt;(LoginButton.java:58)
              at java.lang.reflect.Constructor.newInstance(Native Method)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
              at android.view.LayoutInflater.createView(LayoutInflater.java:607)
              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
              at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
              at android.app.Activity.setContentView(Activity.java:2145)
              at com.dupls.wedding.MainActivity.onCreate(MainActivity.java:25)
              at android.app.Activity.performCreate(Activity.java:5990)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
              at android.app.ActivityThread.access$800(ActivityThread.java:151)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5254)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  </code></pre>
  
  <p>build.gradle (Module: app)</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 22
      buildToolsVersion "22.0.1"
  
      defaultConfig {
          applicationId "com.dupls.wedding"
          minSdkVersion 21
          targetSdkVersion 22
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.facebook.android:facebook-android-sdk:4.0.0'
  }
  </code></pre>
  
  <p>build.gradle (Project):</p>
  
  <pre><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:1.1.0'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
          mavenCentral()
      }
  }
  </code></pre>
  
  <p>I haven't been able to find any determine what the cause of this Exception is. I can instantiate the Facebook SDK objects, I just can't seem to add a LoginButton to my UI. Any ideas? Thanks.</p>