SERVER_ERROR: [code] 1675030 [message]: Error performing query

JavaAndroidFacebookFacebook Login

Java Problem Overview


I am using Facebook login in android.
Code:

callbackManager = CallbackManager.Factory.create();
    LoginButton loginButton = (LoginButton) this.findViewById(R.id.login_button);
    loginButton.setReadPermissions("email", "public_profile");
    loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            // App code
            Log.println(Log.ASSERT, "FB", "inicio session ");
        }

        @Override
        public void onCancel() {
            Log.println(Log.ASSERT, "FB", "OP NO completada");
            // App code
        }

        @Override
        public void onError(FacebookException exception) {
            Log.println(Log.ASSERT, "FB", " Errro de sesion ");
            exception.printStackTrace();
            // App code
        }
    });

but always getting the following error:

> SERVER_ERROR: [code] 1675030 [message]: Error performing query. > [extra]: Errors while executing operation "ProxyAuthAppLoginQuery": At > Query.proxy_auth_app_login: Failed to resolve field. W/System.err:
> at > com.facebook.login.LoginManager.onActivityResult(LoginManager.java:190) > W/System.err: at > com.facebook.login.LoginManager$1.onActivityResult(LoginManager.java:159) > W/System.err: at > com.facebook.internal.CallbackManagerImpl.onActivityResult(CallbackManagerImpl.java:82) > W/System.err: at > com.procibernetica.moca.MainActivity.onActivityResult(MainActivity.java:130) > W/System.err: at > android.app.Activity.dispatchActivityResult(Activity.java:5423) > W/System.err: at > android.app.ActivityThread.deliverResults(ActivityThread.java:3401) > W/System.err: at > android.app.ActivityThread.handleSendResult(ActivityThread.java:3448) > W/System.err: at > android.app.ActivityThread.access$1300(ActivityThread.java:138) > W/System.err: at > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284) > W/System.err: at > android.os.Handler.dispatchMessage(Handler.java:102) W/System.err:
> at android.os.Looper.loop(Looper.java:149) W/System.err: at > android.app.ActivityThread.main(ActivityThread.java:5061) > W/System.err: at java.lang.reflect.Method.invokeNative(Native > Method) W/System.err: at > java.lang.reflect.Method.invoke(Method.java:515) W/System.err: at > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787) > W/System.err: at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603) > W/System.err: at dalvik.system.NativeStart.main(Native Method)

I've added the folowing permissions.

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Java Solutions


Solution 1 - Java

I find the solution, this happends when you don't have evaluate users in your app .

Enter in your panel App Select Rol

enter image description here

And add test users , when your try to login with test users , the application executes without fails

enter image description here

Solution 2 - Java

Documentation on facebook is not correct. I had to add all 3 default permissions to make it work.

loginButton.setReadPermissions("email", "public_profile", "user_friends");

Solution 3 - Java

@Danial answer correct, But I want to add some more in that. This types of error comes only when app your in under development. Follow this [link][1] and select your App. Then you can do two things here. From Roles tab you can allow login to your friends only or else select the App Review and make your app public then any one can able to logged in.

[1]: https://developers.facebook.com/apps/ "Facebook apps"

Solution 4 - Java

I was getting a similar issue because Firebase UI was specifying the android:value. This is how I solved it:

    <application
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme.Base">

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        tools:replace="android:value"
        android:value="@string/facebook_app_id" />
<acitivity
...
</activity>
...

Solution 5 - Java

> Issue Log: SERVER_ERROR: [code] 1675030 [message]: Error performing query

And Accurate Solution for this Specific issue (Error performing query)
is answered by @aloha is by updating the query for access.
loginButton.setReadPermissions("email", "public_profile", "user_friends");

  1. Find where you facebook login button was called.
  2. Then set the ReadPermission for the button as "email", "public_profile", "user_friends"

image Reference

enter image description here

> Issue Log: App Not Setup. This app is still in development mode. and you dont have access to it. register test user or ask an app admin for permission

  1. The app are not in Live Mode
  2. You are not listed as admin or a tester in
    https://developers.facebook.com/app/yourapp
  3. Your App Hashkey are not set. if Facebook app cant be on Live Mode you need a hashkey to test it. because the app are not yet Live. Facebook wont allow an access.

HOW TO CHANGE TO LIVE MODE

  1. go to : https://developers.facebook.com<br>
  2. select your app on "My Apps" List
  3. toggle the switch from OFF to ON

enter image description hereenter image description here

HOW TO ADD AS TEST OR ADMIN

  1. go to : https://developers.facebook.com<br>
  2. select your app on "My Apps" List
  3. go to : Roles > Roles > Press Add for example administratorenter image description here
  4. Search your new admin/tester Facebook account.
    enter image description here
  5. admin must enter facebook password to confirm.then submit enter image description here
    the new admin must go to developer.facebook page and accept the request
  6. go to : https://developers.facebook.com<br>
  7. Profile > Requests > Confirm
    enter image description here List item
  8. Congratulation you have been assign as new Admin

HOW TO GET AND SET HASHKEY FOR DEVELOPMENT
as Refer to Facebook Login Documentation
https://developers.facebook.com/docs/android/getting-started/#create_hash
The most preferable solution by me is by code ( Troubleshooting Sample Apps )
it will print out the hash key. you can update it on
https://developers.facebook.com/apps/yourFacebookappID/settings/basic/
on Android > Key Hashes section

a step by step process on how to get the hashKey.

  1. Firstly Add the code to any oncreate method

enter image description here

  1. Run The app and Search the KeyHash at Logcat

enter image description here

step by step process on how Update on Facebook Developer.

  1. Open Facebook Developer Page. You need access as to update the Facebook Developer page: https://developers.facebook.com

  2. Follow the step as follow.

enter image description here

Solution 6 - Java

All of the above answers didn't help me, what did was when you use this command

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

to get the Key Hashes you put in facebook configurations.

it will ask you for a password, at first I didn't set any, so the issue happened, when I entered android as the password. it worked !

Solution 7 - Java

Live developer mode Please check status of Developer mode. It must be "Live". Firstly, you need add privacy url for own facebook project which you want to test facebook login or sth .... Then enable developer mode (Turn on)

Solution 8 - Java

I just fixed it by going to https://developers.facebook.com/apps/ and select my app then

switch to live mode

"from top left beside app ID"

Solution 9 - Java

In my case the generated hash key was wrong because i was using wrong OpenSSL. I was using openssl-0.9.8k_X64.zip instead of openssl-0.9.8e_X64.zip and this generated me a wrong hash key which caused this problem hope it helps some one i lost like 8 hours trying to figure this out.

Solution 10 - Java

In my case problem was wrong generated Key Hash which need to submit on facebook app page Solution found on this article https://developers.facebook.com/docs/facebook-login/android/advanced

Manually Check Key Hash - You can print out the key hash sent to Facebook and use that value in App Dashboard. Make this change to onCreate() in your main activity:

try 
{
    PackageInfo info = getPackageManager().getPackageInfo(
                        "com.facebook.samples.loginhowto",
                        PackageManager.GET_SIGNATURES);

    for (Signature signature : info.signatures) {
        MessageDigest md = MessageDigest.getInstance("SHA");
        md.update(signature.toByteArray());
        Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
    }
} catch (NameNotFoundException e) {  
 
        
} catch (NoSuchAlgorithmException e) {  
          
}

Solution 11 - Java

for Flutter this was the fix

final LoginResult result = await FacebookAuth.instance.login(
      permissions: [
        'public_profile',
        'email',
        'pages_show_list',
        'pages_messaging',
        'pages_manage_metadata'
      ],
    );

Solution 12 - Java

This error is returned in other situations too - even when your app is public or you're listed as a tester.

Double check that your

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

is resolving to a correct Facebook App ID, especially if you dynamically specify it using gradle build, rather than hard coding it in strings.xml.

Solution 13 - Java

I addition to the other answers please also check that the email of the account being used to log in is verified.

Solution 14 - Java

you need to see if the user that connect in the phone facebook app is a user that have test or developer permissions in the facebook developers on the app page.

Solution 15 - Java

Add a string resource "facebook_application_id" in your strings.xml

replace APP_ID with your facebook app id

<string name="facebook_application_id" translatable="false">APP_ID</string>

Solution 16 - Java

I just added this line and it worked for me.

facebookLogin.setReadPermissions("email", "public_profile", "user_friends");

Solution 17 - Java

try this, locate your app-debug.apk in android build folder

keytool -printcert -jarfile app-debug.apk | openssl sha1 -binary | openssl base64

paste it in facebook key hashes.

Solution 18 - Java

I dont know if this will help but from personal experience when you generate the development key you will need to type a password which is "android" and make sure you add the = after the code when you are adding it in the field on developers facebook domain

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDaniel ORTIZView Question on Stackoverflow
Solution 1 - JavaDaniel ORTIZView Answer on Stackoverflow
Solution 2 - JavaalohaView Answer on Stackoverflow
Solution 3 - JavaAMAN SINGHView Answer on Stackoverflow
Solution 4 - JavaCacheMeOutsideView Answer on Stackoverflow
Solution 5 - JavaMuhammad AsyrafView Answer on Stackoverflow
Solution 6 - JavaAhmad MelegyView Answer on Stackoverflow
Solution 7 - JavaThanh vũView Answer on Stackoverflow
Solution 8 - JavaMomen ZaqoutView Answer on Stackoverflow
Solution 9 - JavaIvanView Answer on Stackoverflow
Solution 10 - Javauser954174View Answer on Stackoverflow
Solution 11 - JavaDeepak YadavView Answer on Stackoverflow
Solution 12 - JavaVoyView Answer on Stackoverflow
Solution 13 - JavaMuddassir AhmedView Answer on Stackoverflow
Solution 14 - JavaOr AzoulayView Answer on Stackoverflow
Solution 15 - JavaS.DView Answer on Stackoverflow
Solution 16 - JavaAbdul Basit RishiView Answer on Stackoverflow
Solution 17 - Javatofi lagmanView Answer on Stackoverflow
Solution 18 - JavahyperscienceView Answer on Stackoverflow