title: Facebook login NullPointerException
body: <p>Am trying to implement the Facebook login for Android using the Facebook SDK (3.17.1) but i am having some issues i haven't had in the past.
  First of all, the login button doesn't render completely. This is what i get</p>
  
  <p><img src="https://i.stack.imgur.com/tmGVx.png" alt="enter image description here"></p>
  
  <p>instead of this:</p>
  
  <p><img src="https://i.stack.imgur.com/pZzc4.png" alt="enter image description here"></p>
  
  <p>(notice the missing Facebook logo). When I run the application, in the split second before it crashes it displays it just the way it should (with the Facebook logo).</p>
  
  <p>When the application crashes, i get this error message </p>
  
  <p><code>"Unfortunately, FacebookLoginTest as stopped"</code></p>
  
  <p>and this in Logcat:</p>
  
  <pre><code>08-12 22:19:08.751: E/AndroidRuntime(7731): FATAL EXCEPTION: AsyncTask #1
  08-12 22:19:08.751: E/AndroidRuntime(7731): Process: com.example.facebooklogintest,    PID: 7731
  08-12 22:19:08.751: E/AndroidRuntime(7731): java.lang.RuntimeException: An error   occured while executing doInBackground()
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at     android.os.AsyncTask$3.done(AsyncTask.java:300)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at  java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at  java.util.concurrent.FutureTask.setException(FutureTask.java:222)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at  java.lang.Thread.run(Thread.java:864)
  08-12 22:19:08.751: E/AndroidRuntime(7731): Caused by: java.lang.NullPointerException
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at   java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:911)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at   com.facebook.internal.Utility.queryAppSettings(Utility.java:377)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at com.facebook.widget.LoginButton$1.doInBackground(LoginButton.java:677)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at com.facebook.widget.LoginButton$1.doInBackground(LoginButton.java:1)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at android.os.AsyncTask$2.call(AsyncTask.java:288)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
  08-12 22:19:08.751: E/AndroidRuntime(7731):     ... 4 more
  08-12 22:19:10.753: D/Process(7731): killProcess, pid=7731
  08-12 22:19:10.753: D/Process(7731):   com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException:131    java.lang.ThreadGroup.uncaughtException:693 java.lang.ThreadGroup.uncaughtException:690 
  </code></pre>
  
  <p>I followed the instructions for adding Facebook login to Android apps:</p>
  
  <ol>
  <li>Imported Facebook sdk</li>
  <li>Added Facebook project as libray</li>
  <li>Added Facebook project to list of references for my project</li>
  <li>Cleaned and even restarted the project.</li>
  </ol>
  
  <p>Besides these, I haven't changed anything in my Activity and manifest.
  I have tried this in three different eclipse versions, all with the same error, but then i delete the Facebook login button code in the .xml file, the app lauches just fine. 
  Not sure what else am supposed to do.
  Here are the MainActivity and Layout.xml codes:</p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>package com.example.facebooklogintest;
  
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  
  
  public class MainActivity extends ActionBarActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
      if (id == R.id.action_settings) {
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  }
  </code></pre>
  
  <p><strong>activity_main.xml</strong></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:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context="com.example.facebooklogintest.MainActivity" &gt;
  
  
  
  &lt;com.facebook.widget.LoginButton
      android:id="@+id/authButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentRight="true"
      android:layout_gravity="center_horizontal"
      android:layout_marginTop="30dp" /&gt;
  
   &lt;/RelativeLayout&gt;
  </code></pre>