无法解析Twitter的SDK
问题描述:
在构建Android项目我得到这个错误:无法解析Twitter的SDK
Error:Failed to resolve: com.twitter.sdk.android:twitter:2.0.0
这是我的gradle这个文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.khurana.nikhil.tuhub"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "3363b4de-b4d3-45c7-a74a-2d75d7a97848",
onesignal_google_project_number: "561678063868"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.+'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui:1.0.0'
compile 'com.onesignal:OneSignal:[email protected]'
compile 'com.google.android.gms:play-services-gcm:10.0.0'
compile 'com.google.android.gms:play-services-analytics:10.0.0'
compile 'com.google.android.gms:play-services-location:10.0.0'
compile 'com.google.firebase:firebase-core:10.0.0'
compile 'com.google.android.gms:play-services:10.0.0'
}
apply plugin: 'com.google.gms.google-services'
我试图在后一个提到的这个方法,但那没用。下面是我找到了解决办法: 添加此项目gradle这个库部分
maven { url 'https://maven.fabric.io/repo' }
但这并没有工作。 试过这个:maven { url 'https://maven.fabric.io/repo' }
答
添加存储库为我工作。这里是我的gradle建设(项目)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// Google Play Services classpath
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
希望这有助于:)
https://github.com/firebase/FirebaseUI-Android/issues/392 –
感谢队友。我已经访问过那个链接,但是没有注意到,存储库行也必须添加到应用程序gradle文件中。再次感谢。 –