[英]Android Twitter and Fabric Integration
I'm trying to implement twitter sign in for my android app (also crashlytics). 我正在尝试为我的Android应用程序(也是crashlytics)实现twitter登录。 But I have a problem with my gradle; 但是我的gradle有问题。 funny thing is I did this before for another app. 有趣的是,我之前为另一个应用程序做了这个。 Here's my app-level 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'
I'm getting the errors: 我遇到了错误:
Failed to resolve: com.twitter.sdk.android:twitter-core:2.3.2 无法解决:com.twitter.sdk.android:twitter-core:2.3.2
Failed to resolve: annotationProcessor 无法解决:annotationProcessor
Also, when I change to twitter 2.3.0 , my Twitter object is not found 另外,当我更改为twitter 2.3.0时,找不到我的Twitter对象
Use twitter instead of twitter-core : 使用twitter而不是twitter-core:
compile('com.twitter.sdk.android:twitter:2.3.2@aar') {
transitive = true;
}
I tested it and worked fine with the annotation processor. 我对其进行了测试,并与注释处理器一起正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.