🌐
Solvusoft
solvusoft.com › en › errors › runtime-errors › facebook-inc › facebook › 0-null-facebook-error-0-null
How To Fix Facebook Error 0 ((null)) - Solvusoft
November 17, 2024 - Error 0 ((null)) problems include computer crashes, freezes, and possible virus infection. Learn how to fix these Facebook runtime errors quickly and easily!
Discussions

Why my Facebook saying null - Apple Community
Why is my Facebook is being there was an error fetching the data Why is my Facebook is being there was an error fetching the data thank you 573 3 More on discussions.apple.com
🌐 discussions.apple.com
October 4, 2021
Cannot read property 'facebook' of null
Issue Description Users report that they have trouble logging in and we see these entries in the NodeJS logs quite frequently since some hours: error: Uncaught internal server error.Cannot read property 'facebook' of null { "stack": "Typ... More on github.com
🌐 github.com
18
October 17, 2019
flutter - facebook login is passing null - Stack Overflow
i am trying to login with facebook and i keep getting null, and it will give uid but rest will be null here is the error. D/FirebaseAuth(30710): Notifying id token listeners about user ( More on stackoverflow.com
🌐 stackoverflow.com
May 11, 2021
Android facebook applicationId cannot be null - Stack Overflow
If the applicatiodId is reported as null by the Facebook sdk because of some error in the String resource parsing, you can manually set the applicationId after initializing the sdk. More on stackoverflow.com
🌐 stackoverflow.com
🌐
Apple Community
discussions.apple.com › thread › 253219438
Why my Facebook saying null - Apple Community
October 4, 2021 - Problem with responding to Facebook Hello I am having issues responding to Facebook. I get this “ Exception was thrown during the execution of query. Check your server logs for more information. What does that mean?
🌐
Error Vault
errorvault.com › en › troubleshooting › runtime-errors › facebook-inc › facebook › error-0-null_facebook-error-code-0-null
How to fix Error 0 Null (Facebook Error Code 0 Null) - Error 0 Null: Facebook has encountered a problem and needs to close. We are sorry for the inconvenience.
Error name: Facebook Error Code 0 Null Error number: Code 0 Null Description: Error 0 Null: Facebook has encountered a problem and needs to close. We are sorry for the inconvenience. Software: Facebook Developer: Facebook Inc.
🌐
GitHub
github.com › parse-community › parse-server › issues › 6140
Cannot read property 'facebook' of null · Issue #6140 · parse-community/parse-server
October 17, 2019 - Issue Description Users report that they have trouble logging in and we see these entries in the NodeJS logs quite frequently since some hours: error: Uncaught internal server error.Cannot read property 'facebook' of null { "stack": "Typ...
Author   mtrezza
🌐
Stack Overflow
stackoverflow.com › questions › 67493242 › facebook-login-is-passing-null
flutter - facebook login is passing null - Stack Overflow
May 11, 2021 - GestureDetector( onTap: ()async { final progress = ProgressHUD.of(context); progress?.showWithText('Loging in...'); try { final facebook = await AuthenticationApi().signInFacebook(); if(facebook){ await checkDataFromDB(); progress?.dismiss(); }else{ progress?.dismiss(); await Flushbar( title: 'Ops!', message: 'Sign in not completed, Try again!!!', duration: Duration(seconds: 3), ).show(context); } } on PlatformException catch (err){ progress?.dismiss(); await Flushbar( title: 'Ops!', message: 'error ${err.code}', duration: Duration(seconds: 3), ).show(context); } catch (e) { print('...........this is the error $e'); progress?.dismiss(); await Flushbar( title: 'Ops!', message: 'error $e', duration: Duration(seconds: 3), ).show(context); } }, child: LoginBtn( icon: FontAwesomeIcons.facebook, ), ),
Find elsewhere
Top answer
1 of 5
224

TL;DR: you have to write your application's ID in your strings.xml and then reference (i.e. @strings/fb_app_id), because if you put it directly (as value) into AndroidManifest.xml it won't work.

you must define your applicationId in the AndroidManifest.xml like this:

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>

under <application android:label="@string/app_name".... tag

where app_id is a string within your strings.xml.


sample:

 <application android:label="@string/app_name"
                 android:icon="@drawable/icon"
                 android:theme="@android:style/Theme.NoTitleBar"
            >
        <activity android:name=".HelloFacebookSampleActivity"
                  android:label="@string/app_name"
                  android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name="com.facebook.LoginActivity"
                  android:theme="@android:style/Theme.Translucent.NoTitleBar"
                  android:label="@string/app_name" />
        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>
    </application>

** please note <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/> is within <application> tag

-- and in strings.xml

<string name="app_id">1389xxxxxxxx</string>
2 of 5
8

Since today the answer is not quite correct. If someone didn't use this: AppEventsLogger.activateApp(this);

Since last update you must do it or your app will crashed. And you also should pass Application here not Context

https://developers.facebook.com/docs/android/getting-started

// Add this to the header of your file:
import com.facebook.FacebookSdk;

public class MyApplication extends Application {
    // Updated your class body:
    @Override
    public void onCreate() {
        super.onCreate();
        // Initialize the SDK before executing any other operations,
        FacebookSdk.sdkInitialize(getApplicationContext());
        AppEventsLogger.activateApp(this);
    }
}
🌐
Stack Overflow
meta.stackoverflow.com › questions › 360768 › null-profile-image-selectable-from-facebook
Null profile image selectable from Facebook - Meta Stack Overflow
Object with ID '271413073289488' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api" - So you need to make sure you have a picture and that it's publicly accessible or upload the picture yourself...
🌐
Wordswithfriends
ask.wordswithfriends.net › index.php › 2716 › just-logged-into-acct-within-name-shows-null-null-why-and-how
I just logged into FB acct within the app and my name shows as 'null null'. Why and how can I fix it? - WordsWithFriends.net Ask Us
Welcome to WordsWithFriends.net Q&A, where you can ask questions and receive answers from other members of the community · I just logged into FB acct within the app and my name shows as 'null null'. Why and how can I fix it · When the game board is open it shows my name as null null when ...
🌐
Solvusoft
solvusoft.com › en › errors › runtime-errors › facebook-inc › facebook › 0-null-facebook-error-code-0-null
How To Fix Facebook Error 0 Null
Error 0 Null problems include computer crashes, freezes, and possible virus infection. Learn how to fix these Facebook runtime errors quickly and easily!
Top answer
1 of 2
1

Try this Code I hope Its Work..

   facebookimage(object.getString("id"));

This is Method:

 private void facebookimage(String id) {
        new getFacebookImage(id).execute();
    }

This is AsyncTask class to get Profile Image on Facebook ;

private class getFacebookImage extends AsyncTask {

        String userID;
        Bitmap camera;

        public getFacebookImage(String id) {
            userID=id;
        }

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
        }

        @Override
        protected Object doInBackground(Object[] params) {


            URL imageURL = null;
            Bitmap bitmap=null;
            try {
                imageURL = new URL("https://graph.facebook.com/" + userID + "/picture?type=large");
                bitmap = BitmapFactory.decodeStream(imageURL.openConnection().getInputStream());
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
            Log.e("String Image",""+bitmap);
            camera=bitmap;
            return bitmap;
        }

        @Override
        protected void onPostExecute(Object o) {
            super.onPostExecute(o);

            if(camera != null){
                Log.e("Image Load","UPload image");
                ByteArrayOutputStream stream = new ByteArrayOutputStream();
                camera.compress(Bitmap.CompressFormat.JPEG, 100, stream);
                byte imageInByte[] = stream.toByteArray();
                String encodedImage = Base64.encodeToString(imageInByte, Base64.DEFAULT);
                DataBase.setUserImage(LoginActivity.this,encodedImage);

            }

        }
    }
2 of 2
0

Initially I was getting only id and email in JSONObject object of onCompleted. Even though I set permissions like "public_profile" and "email" which is sufficient enough to get the id, name, email and profile picture from facebook. But somewhere I went wrong and didn't understand and added Profile and did getProfile() so I can get the name and profile picture. Then other problem arised was even after login perfectly, I was getting null profile sometimes(may be once in 5 times). For that had to put Profile Tracker and this was because Profile works Asynchronously(was too confusing for me as you have to put trackers and start & stop tracking).

Then I realized where I went wrong. In the bundle where we need to mention what all we want in the json object as reply, I had only mentioned "id". So now in the below code I added "name" and "email" as well. So in the JSONObject object response I get the name and email as well.

And for profile picture I saw How can I display the users profile pic using the facebook graph api? and implemented this using Uri builder Use URI builder in Android or create URL with variables . So with this I removed the use of Profile completely and still getting all the data I wanted.

This answer is the mixture of both the answers mentioned by Destro - Android Facebook Login- Profile is null & How to get email id From Android Facebook SDK 4.6.0?

FacebookCallback<LoginResult> facebookCallback = new FacebookCallback<LoginResult>() {

        @Override
        public void onSuccess(final LoginResult loginResult) {


            GraphRequest request = GraphRequest.newMeRequest(
                    loginResult.getAccessToken(),
                    new GraphRequest.GraphJSONObjectCallback() {
                        @Override
                        public void onCompleted(JSONObject object, GraphResponse response) {

                            if (BuildConfig.DEBUG) {
                                FacebookSdk.setIsDebugEnabled(true);
                                FacebookSdk.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);


                                String uid = object.optString("id");
                                String email = object.optString("email");
                                String name = object.optString("name");

                                Uri.Builder builder = new Uri.Builder();
                                builder.scheme("https")
                                        .authority("graph.facebook.com")
                                        .appendPath(uid)
                                        .appendPath("picture")
                                        .appendQueryParameter("width", "1000")
                                        .appendQueryParameter("height", "1000");

                                Uri pictureUri = builder.build();

                                try {
                                    sendLogin(uid, name, email, pictureUri.toString(), "fb");
                                } catch (JSONException e) {
                                    e.printStackTrace();
                                } catch (IOException e) {
                                    e.printStackTrace();
                                }
                                facebookLogout();

                            }
                        }
                    });
            Bundle parameters = new Bundle();
            parameters.putString("fields", "id, name, email");
                    request.setParameters(parameters);
            request.executeAsync();
        }

        @Override
        public void onCancel() {
        }

        @Override
        public void onError(FacebookException e) {
            Toast.makeText(getApplication(), "Something went wrong, please try again later", Toast.LENGTH_LONG).show();
        }
    };

    public void facebookLogout() {
        LoginManager.getInstance().logOut();
    }
🌐
GitHub
github.com › facebook › facebook-android-sdk › issues › 1132
Facebook Login - Obtain null Authentication token · Issue #1132 · facebook/facebook-android-sdk
November 7, 2022 - val fBLoginManager = com.facebook.login.LoginManager.getInstance() fBLoginManager.registerCallback(mFaceBookCallbackManager, object : FacebookCallback<LoginResult> { override fun onCancel() { Log.i(TAG, "facebook: onCancel") } override fun onError(error: FacebookException) { Log.i(TAG, "facebook: error$error") } override fun onSuccess(result: LoginResult) { Log.i(TAG, "facebook: onSuccess") //not empty val accessToken = result.accessToken //empty val authenticationToken = result.authenticationToken } }) fBLoginManager.logInWithReadPermissions(mFragment.fragment, mFaceBookCallbackManager, listOf("email", "public_profile")) 👍React with 👍3andirihs, ViktorAkselrod and codefluencer ·
Author   DRPrincess
🌐
Stack Overflow
stackoverflow.com › questions › 32276556 › facebook-graph-api-returning-null-values
php - Facebook graph API returning null values - Stack Overflow
$fb = new Facebook\Facebook([ 'app_id' => '{app-id}', 'app_secret' => '{app-secret}', 'default_graph_version' => 'v2.2', ]); $helper = $fb->getRedirectLoginHelper(); try { $accessToken = $helper->getAccessToken(); } catch(Facebook\Exceptions\FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' .
🌐
XDA Forums
xdaforums.com › home › google › nexus one › nexus one general
Facebook Help: Help: An error had occurred while fetching data [null] | XDA Forums
March 18, 2010 - It's a problem with some 3rd party apps that push data to your facebook feed and the client's interpretation of the XML. Zynga apps being one of them. You can experiment by hiding various 3rd party apps form your facebook feed (or logging in ...
🌐
Early Bird Club
forum.earlybird.club › tech forums › smartphones
Help - Facebook showing [null] error | Early Bird Club
September 17, 2010 - I started getting it straight after I updated to 2.10.405.2 but I've just checked it and after logging out, clearing all Facebook app data and re-loging in it's now working.