1

我寫了一個使用Firebase數據庫功能的Android應用程序。一切工作正常,現在我想集成身份驗證功能。所以我修改的build.gradle的應用包括兩個依賴的身份驗證:android上的firebase:身份驗證和數據庫,gradle同步錯誤

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.example.gmeunier.gestiondepoints" 
     minSdkVersion 23 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 

    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:support-v4:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4' 
    compile 'com.android.support:cardview-v7:25.3.1' 
    compile 'com.google.android.gms:play-services-plus:10.2.6' 
    compile 'com.google.firebase:firebase-database:10.2.6' 

    compile 'com.firebaseui:firebase-ui-auth:1.2.0' 
    compile 'com.google.firebase:firebase-auth:10.2.6' 

    testCompile 'junit:junit:4.12' 
} 
apply plugin: 'com.google.gms.google-services' 

儘管我對這個主題的所有的努力和研究,我還是有以下錯誤,當我嘗試同步此gradle這個:

無法解析:com.twitter.sdk.android:twitter:2.3.0

我無法找到我必須用它的lib /組件的版本,我將不勝感激幫助和支持。

回答

0

你的項目的gradle文件應該是這樣的。

buildscript { 
    repositories { 
     jcenter() 
    } 

    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.3' 
     classpath 'com.google.gms:google-services:3.0.0' 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 

     // Required for 'com.firebaseui:firebase-ui:1.1.1' 
     maven { 
      url 'https://maven.fabric.io/public' 
     } 
    } 
} 

原來的答覆:https://stackoverflow.com/a/41664069/7339411

+0

它的作品!非常感謝。我真的不明白爲什麼我現在需要這個maven的東西,而不是之前(即只有數據庫功能在我的應用程序中使用) – R42136

0

添加以下行 「倉庫」,裏面的 「allprojects」 和 「buildscript」 你的項目級的build.gradle文件中:

maven { 
    url 'https://maven.fabric.io/public' 
}