I can try to help you out since I just went through the facebook log in and pull back name and email but we really need to see all your code. I'd post all that you can that has anything to do with how you are using facebook classes. Here are parts of what I used if it helps at all:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(getApplicationContext());
callbackManager = CallbackManager.Factory.create();
loginButtonFacebook = (LoginButton) findViewById(R.id.login_button_facebook);
loginButtonFacebook.setReadPermissions("user_friends,email");
LoginManager.getInstance().registerCallback(callbackManager,
new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
accessToken = loginResult.getAccessToken();
final SharedPreferences.Editor editor = prefs.edit();
editor.putString("facebookAccessToken", accessToken.getToken()).apply();
GraphRequest request = GraphRequest.newMeRequest(
accessToken,
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject object, GraphResponse response) {
getFacebookItems(object);
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,first_name,last_name,email,picture");
request.setParameters(parameters);
request.executeAsync();
}
@Override
public void onCancel() {
Log.d(TAG, "Canceled");
}
@Override
public void onError(FacebookException exception) {
Log.d(TAG, String.format("Error: %s", exception.toString()));
}
});
}
....
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
callbackManager.onActivityResult(requestCode, resultCode, data);
}
public void getFacebookItems(JSONObject object){
try {
facebookId = object.getString("id");
facebookName = object.getString("name");
facebookFirstName = object.getString("first_name");
facebookLastName = object.getString("last_name");
facebookEmail = object.getString("email");
}catch (JSONException e) {
e.printStackTrace();
}
}
I also access facebook user friends from another activity so I store my accesstoken in preferences for when I need it later.
accessTokenString = prefs.getString("facebookAccessToken", "");
String facebookId = prefs.getString("facebookId", "");
if (facebookId.length() > 0 && accessTokenString.length() > 0) {
accessToken = new AccessToken(accessTokenString, getString(R.string.facebook_app_id), facebookId, null, null, null, null, null);
storeFacebookFriends();
}
....
public void storeFacebookFriends(){
if (accessToken != null) {
GraphRequestBatch batch = new GraphRequestBatch(
GraphRequest.newMyFriendsRequest(
accessToken,
new GraphRequest.GraphJSONArrayCallback() {
@Override
public void onCompleted(JSONArray jsonArray, GraphResponse response) {
// Application code for users friends
userArray = jsonArray;
}
})
);
batch.addCallback(new GraphRequestBatch.Callback() {
@Override
public void onBatchCompleted(GraphRequestBatch graphRequests) {
// Application code for when the batch finishes
}
});
batch.executeAsync();
}
}