Как программно выйти из сеанса твиттера с помощью Fabric sdk

Я делаю приложение, которое требует входа в систему с учетной записью Twitter, все работает нормально, но когда я пытаюсь выйти из системы программно, оно не работает, и я использую sdk Fabric. Этот вопрос уже задавали много раз, но решение не сработало для меня. Я проверил это Как выйти из твиттера с помощью Fabric Sdk для Android Но проблема в том, что для этого требуется использовать функцию Twitter.logOut(), на которую ide показывает мне сообщение о том, что он не может разрешить метод logOut(), что означает, что метод больше не доступен, это градиент проекта:

   // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.2.0'
        classpath 'io.fabric.tools:gradle:1.25.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
        google()
        maven { url 'https://maven.fabric.io/public' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

и это приложение gradle:

    apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 26
    buildToolsVersion "28.0.0-rc1"
    defaultConfig {
        applicationId "arb.passwordmanager"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation project(':library')
    implementation project(':jsoup-1.10.3')
    implementation 'com.google.firebase:firebase-core:12.0.1'
    implementation 'com.android.support:appcompat-v7:26.0.0-alpha1'

    implementation 'com.android.support:design:26.0.0-alpha1'
    implementation 'com.android.support:support-v4:26.0.0-alpha1'
    implementation 'com.android.support:support-vector-drawable:26.0.0-alpha1'
    implementation 'com.google.android.gms:play-services-auth:12.0.1'

    // compile 'com.google.android.gms:play-services-appindexing:9.8.0'
    implementation 'com.google.firebase:firebase-appindexing:12.0.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:recyclerview-v7:26.0.0-alpha1'
    implementation 'com.android.support:cardview-v7:26.0.0-alpha1'
    implementation 'com.android.support:palette-v7:26.0.0-alpha1'
    implementation 'com.squareup.picasso:picasso:2.4.0'
    implementation 'com.android.support:support-v13:26.0.0-alpha1'
    implementation 'com.google.firebase:firebase-auth:12.0.1'
    testImplementation 'junit:junit:4.12'
    implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
    /*implementation('com.twitter.sdk.android:twitter-core:1.6.3@aar') {
        transitive = true;
    }*/
    /*compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
        transitive = true
    }*/
    //implementation 'com.twitter.sdk.android:twitter-core:3.1.1'
    implementation 'com.twitter.sdk.android:twitter:3.1.1'
}
apply plugin: 'com.google.gms.google-services'

любые альтернативы этому методу или другой способ, который может быть полезен, пожалуйста


person Bug fixed    schedule 08.04.2018    source источник
comment
Добавьте свой build.gradle .   -  person ADM    schedule 08.04.2018
comment
Я добавляю это сейчас @ADM   -  person Bug fixed    schedule 08.04.2018
comment
Нет, там тоже нет метода logOut @ADM   -  person Bug fixed    schedule 09.04.2018


Ответы (1)


Попробуйте с помощью приведенного ниже кода удалить файлы cookie.

CookieSyncManager.createInstance(activity.this);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
person Jes    schedule 30.11.2020