title: Facebook OAuth on Android
body: <p>Every time I test out my app on the emulator. "An error occurred with AppName. Please try again later." I have enabled internet access in the manifest .XML.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>package com.xxxxxx;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.TextView;
  
  import com.facebook.android.DialogError;
  import com.facebook.android.Facebook;
  import com.facebook.android.Facebook.DialogListener;
  import com.facebook.android.FacebookError;
  import com.facebook.android.Util;
  
  public class LunchtimeActivity extends Activity {
  
      Facebook facebook = new Facebook("xxxxxxxxxxxxxx");
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //setContentView(R.layout.main);
  
          facebook.authorize(this, new String [] {"user_location", "friend_location", "user_events", "friends_events"}, new DialogListener() {
              @Override
              public void onComplete(Bundle values) {}
  
              @Override
              public void onFacebookError(FacebookError error) {}
  
              @Override
              public void onError(DialogError e) {}
  
              @Override
              public void onCancel() {}
          });
  
          Bundle parameters = new Bundle();
          parameters.putString( "fields", "id,name" ); 
  
          try {
              String response = facebook.request( "me/friends", parameters ); 
  
              JSONObject json = Util.parseJson( response );
  
              JSONArray data = json.getJSONArray( "data" );
  
              for ( int i = 0; i &lt; data.length(); i++ )
              {
                  JSONObject friend = data.getJSONObject( i );
  
                  String id = friend.getString( "id" );
                  String name = friend.getString( "name" );
                  Log.v("JSON", id);
                  Log.v("JSON", name);
              }
          }
          catch (Exception e) {}
          catch (FacebookError f) {}
  
          TextView tv = new TextView(this);
          tv.setText("Hello, Android");
          setContentView(tv);
      }
  
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
  
          facebook.authorizeCallback(requestCode, resultCode, data);
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/zaTdi.png" alt="enter image description here"></p>
  
  <p>Logcat output:</p>
  
  <pre><code>...
  05-01 02:21:01.601: DEBUG/Facebook-WebView(234): Webview loading URL: fbconnect://success/?error=invalid_scope&amp;error_description=Unsupported+scope%3A+%27friend_location...
  </code></pre>
  
  <p>Eclipse console output: </p>
  
  <pre><code>[2011-05-01 02:18:57 - Lunchtime_1.0] ------------------------------
  [2011-05-01 02:18:57 - Lunchtime_1.0] Android Launch!
  [2011-05-01 02:18:57 - Lunchtime_1.0] adb is running normally.
  [2011-05-01 02:18:57 - Lunchtime_1.0] Performing com.lunch.LunchtimeActivity activity launch
  [2011-05-01 02:18:57 - Lunchtime_1.0] Automatic Target Mode: Preferred AVD 'Now' is not available. Launching new emulator.
  [2011-05-01 02:18:57 - Lunchtime_1.0] Launching a new emulator with Virtual Device 'Now'
  [2011-05-01 02:19:03 - Emulator] 2011-05-01 02:19:03.471 emulator[3575:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
  [2011-05-01 02:19:03 - Lunchtime_1.0] New emulator found: emulator-5554
  [2011-05-01 02:19:03 - Lunchtime_1.0] Waiting for HOME ('android.process.acore') to be launched...
  [2011-05-01 02:20:20 - Lunchtime_1.0] WARNING: Application does not specify an API level requirement!
  [2011-05-01 02:20:20 - Lunchtime_1.0] Device API version is 7 (Android 2.1-update1)
  [2011-05-01 02:20:20 - Lunchtime_1.0] HOME is up on device 'emulator-5554'
  [2011-05-01 02:20:20 - Lunchtime_1.0] Uploading Lunchtime_1.0.apk onto device 'emulator-5554'
  [2011-05-01 02:20:20 - Lunchtime_1.0] Installing Lunchtime_1.0.apk...
  [2011-05-01 02:20:39 - Lunchtime_1.0] Success!
  [2011-05-01 02:20:39 - Lunchtime_1.0] Starting activity com.lunch.LunchtimeActivity on device emulator-5554
  [2011-05-01 02:20:43 - Lunchtime_1.0] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.lunch/.LunchtimeActivity }
  </code></pre>
  
  <p>I'm literally just using the Facebook SDK provided by Facebook itself for Android and I can't make it work. Any ideas?</p>