Q:

Facebook error : application ID is invalid

Hey i get this error using the SDK though the app ID is correct.
Now when i try to authorize the app, it works fine and authorizes it, but when i try and make requests, facebook returns this error. My app is initlized properly and is not in sandbox mode.
I found No info about this problem, does someone know what can cause this?
I'm trying to upload photo using The following code :
    byte[] data = null; 

Bitmap bi = BitmapFactory.decodeFile(photoToPost); 
ByteArrayOutputStream baos = new ByteArrayOutputStream(); 
bi.compress(Bitmap.CompressFormat.JPEG, 100, baos); 
data = baos.toByteArray(); 

Bundle params = new Bundle(); 
params.putString("method", "photos.upload"); 
params.putByteArray("picture", data); 

AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook); 
mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null); 

SampleUploadListener :
    public class SampleUploadListener extends BaseRequestListener { 

    public void onComplete(final String response, final Object state) { 
        try { 
            // process the response here: (executed in background thread) 
            Log.d("Facebook-Example", "Response: " + response.toString()); 
            JSONObject json = Util.parseJson(response); 
            final String src = json.getString("src"); 

            // then post the processed result back to the UI thread 
            // if we do not do this, an runtime exception will be generated 
            // e.g. "CalledFromWrongThreadException: Only the original 
            // thread that created a view hierarchy can touch its views." 

        } catch (JSONException e) { 
            Log.w("Facebook-Example", "JSON Error in response"); 
        } catch (FacebookError e) { 
            Log.w("Facebook-Example", "Facebook Error: " + e.getMessage()); 
        } 
    } 

    @Override 
    public void onFacebookError(FacebookError e, Object state) { 
        // TODO Auto-generated method stub 

    } 
} 

A:

I Solved the problem.
THe problem was i created 2 instances of the Facebook object, one as global and one inside the method preforming the code mentioned above, So what happened is i never authorized the Object i tried doing the request is.
For some reason the error dosen't say that but  in case this happens to you, make sure you have initialised the right Object and it has a valid session

