Android Twitter 和 Fabric 集成

Android Twitter and Fabric Integration

我正在尝试为我的 android 应用程序(也是 crashlytics)实现 Twitter 登录。但是我的 gradle 有问题;有趣的是我之前为另一个应用程序做过这个。这是我的应用级别 gradle:

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        // These docs use an open ended version so that our plugin
        // can be updated quickly in response to Android tooling updates

        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

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

repositories {
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.stuff.stuffapp"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile('io.socket:socket.io-client:0.8.3') {
        exclude group: 'org.json', module: 'json'
    }
    compile 'com.android.support:recyclerview-v7:25.1.1'
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:design:25.1.1'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.jakewharton:butterknife:8.4.0'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'com.android.support:support-v4:25.1.1'
    compile 'com.android.support:cardview-v7:25.1.1'
    compile 'com.iainconnor:objectcache:0.0.19-SNAPSHOT'
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile('com.twitter.sdk.android:twitter-core:2.3.2@aar') {
        transitive = true;
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
        transitive = true;
    }
}

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

我遇到错误:

解析失败:com.twitter.sdk.android:twitter-core:2.3.2

解析失败:annotationProcessor

此外,当我更改为 twitter 2.3.0 时,找不到我的 Twitter 对象

使用推特而不是推特核心:

compile('com.twitter.sdk.android:twitter:2.3.2@aar') {
    transitive = true;
}

我对其进行了测试,并在注释处理器上运行良好。