无法找到使用Fabric导入com.twitter.sdk.android.twitter的符号

无法找到使用Fabric导入com.twitter.sdk.android.twitter的符号,android,twitter,android-studio,android-gradle-plugin,twitter-fabric,Android,Twitter,Android Studio,Android Gradle Plugin,Twitter Fabric,Twitter的Fabric平台/SDK是全新的。我一直在尝试将它集成到我现有的build.gradle中,但到目前为止,它还是一片混乱 当我尝试通过Fabric插件安装“使用Twitter登录”功能时,它会更新build.gradle,然后在同步过程中抛出以下错误: Note: Resolve log file to C:\Users\Mark\AndroidStudioProjects\StarkEnglish2\app\build\generated\source\apt\androida

Twitter的Fabric平台/SDK是全新的。我一直在尝试将它集成到我现有的
build.gradle
中,但到目前为止,它还是一片混乱

当我尝试通过Fabric插件安装“使用Twitter登录”功能时,它会更新build.gradle,然后在同步过程中抛出以下错误:

Note: Resolve log file to C:\Users\Mark\AndroidStudioProjects\StarkEnglish2\app\build\generated\source\apt\androidannotations.log
Note: Initialize AndroidAnnotations 3.3.1 with options {androidManifestFile=C:\Users\Mark\AndroidStudioProjects\StarkEnglish2\app\build\intermediates\manifests\full\debug\AndroidManifest.xml}
C:\Users\Mark\AndroidStudioProjects\StarkEnglish2\app\src\main\java\com\starkenglish\app\StarkApplication.java:5: error: cannot find symbol
import com.twitter.sdk.android.Twitter;
                              ^
  symbol:   class Twitter
  location: package com.twitter.sdk.android
warning: The following options were not recognized by any processor: '[androidManifestFile]'
1 error

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
我当前的android项目build.gradle是:

apply plugin: 'com.android.application'


buildscript {
    repositories {
        mavenCentral()

        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        // replace with the current version of the Android plugin
        classpath 'com.android.tools.build:gradle:1.2.3'

        classpath 'io.fabric.tools:gradle:1.+'

        // replace with the current version of the android-apt plugin
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'



    }
}


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


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


def AAVersion = '3.3.1'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
    }
    defaultConfig {
        applicationId "..."
        minSdkVersion 19
        targetSdkVersion 21
        versionCode 2
        versionName '1.0.1'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('com.twitter.sdk.android:twitter-core:1.3.2@aar') {
        transitive = true;
    }
    compile 'com.firebase:firebase-client-android:2.0.3'
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.google.android.gms:play-services:7.3.0'
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.easing:library:1.0.1@aar'
    compile 'com.daimajia.androidanimations:library:1.1.3@aar'
    //compile 'com.facebook.android:facebook-android-sdk:4.1.0'
    compile 'com.github.gabrielemariotti.cards:cardslib-core:2.1.0'
    compile 'com.github.gabrielemariotti.cards:cardslib-cards:2.1.0'
    compile 'com.github.gabrielemariotti.cards:cardslib-recyclerview:2.1.0'
}


apt {
    arguments {
        androidManifestFile variant.outputs[0].processResources.manifestFile
        // if you have multiple outputs (when using splits), you may want to have other index than 0

        // You can set optional annotation processing options here, like these commented options:
        // logLevel 'INFO'
        // logFile '/var/log/aa.log'
    }

}
不知何故,Fabric的SDK部分加载,但当我尝试导入任何东西
com.twitter.SDK.android.twitter
时,我收到“无法解析twitter符号”错误

我有:

  • 清理和重建项目
  • 缓存失效并重新启动Android Studio
  • 重新启动计算机
你知道为什么它只能部分加载吗?这些带有插件的笨重SDK开始让我发疯:-/


任何帮助/指导都将不胜感激。

在下面这一行中替换twitter核心

compile('com.twitter.sdk.android:twitter-core:1.3.2@aar') {
        transitive = true;
    }
用推特 看起来是这样的

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

替换下面这行中的twitter核心

compile('com.twitter.sdk.android:twitter-core:1.3.2@aar') {
        transitive = true;
    }
用推特 看起来是这样的

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

谢谢我刚刚将它更新为使用
TwitterAuthConfig(key,secret)
而不是
Twitter(key,secret)
。不确定哪一个更正确,但它正在工作。谢谢。我刚刚将它更新为使用
TwitterAuthConfig(key,secret)
而不是
Twitter(key,secret)
。不确定哪个更正确,但它现在正在工作。