Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Why Facebook SDK Logout button not showing?

I have developed an app with facebook login, there is no problem in the login process. But I do not see the button when I want to logout.

Broken App Screenshot

BROKEN APP

Working App Screenshot

WORKING APP

Broken app gradle files;

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"
    defaultConfig {
        applicationId "com.ex.ex"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    // Glide image library
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.google.android.gms:play-services-auth:9.2.1'
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'

    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

What is the source of the problem? How can i fix this?

Thanks.

like image 241
Berat Eyüboğlu Avatar asked Feb 24 '17 08:02

Berat Eyüboğlu


People also ask

How do I logout of Facebook programmatically on Android?

So far, to log out Facebook programmatically, I used : Session session = Session. getActiveSession(); session. closeAndClearTokenInformation();

What is the latest Facebook SDK version?

The current version of the Facebook SDK for Android is version 14.1. 1 and requires the Android API 15. Code and samples for the Facebook SDK for Android are available on GitHub. When you use the Facebook SDK for Android, follow the Facebook Open Source Terms of Use and Privacy Policy.


1 Answers

Try to Follow Facebook for Android Documentation

and use Latest Version compile 'com.android.support:appcompat-v7:25.2.0'

Follow this tutorial

compile 'com.google.android.gms:play-services:10.2.0'
like image 150
Atif AbbAsi Avatar answered Oct 19 '22 12:10

Atif AbbAsi