2016-12-29 2 views
3

Я пытаюсь создать базу данных реального времени, используя Firebase. Я следовал принципам, но показывал ошибки.Firebase Android показывает ошибку в зависимости

мое build.gradle приложение выглядит следующим образом:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 24 
    buildToolsVersion "24.0.3" 
    defaultConfig { 
     applicationId "com.example.ashik.project" 
     minSdkVersion 17 
     targetSdkVersion 24 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 


    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:multidex:1.0.1' 
    compile "com.squareup.picasso:picasso:2.4.0" 

    compile 'com.google.firebase:firebase-core:9.0.2' 
    compile 'com.google.firebase:firebase-database:9.0.2' 
    compile 'com.android.support:appcompat-v7:24.0.0' 
    compile 'com.android.support:support-v4:24.0.0' 
    compile 'com.android.support:design:24.0.0' 
    compile 'com.firebase:firebase-client-android:2.5.2+' 
    compile 'com.firebaseui:firebase-ui:0.3.1' 
    compile 'com.github.dakatso:livebutton:1.0.0' 
    compile 'com.jakewharton:butterknife:7.0.1' 
    compile 'com.squareup.picasso:picasso:2.4.0' 
    compile 'de.hdodenhof:circleimageview:2.1.0' 
    compile 'com.balysv:material-ripple:1.0.2' 
    compile 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.google.android.gms:play-services:9.0.2' 
    compile 'com.google.android.gms:play-services-ads:9.0.2' 
    compile 'com.google.android.gms:play-services-auth:9.0.2' 
    compile 'com.google.android.gms:play-services-gcm:9.0.2' 
    compile 'org.jsoup:jsoup:1.10.1' 
    compile 'com.facebook.stetho:stetho-okhttp:1.4.1' 
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3' 
} 
apply plugin: 'com.google.gms.google-services' 

и мой build.gradle проект:

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.1' 

     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() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

Показаны ошибки в консоли:

Error:FAILURE: Build failed with an exception. 
  • Что пошло не так: m возникла настройка проекта ': app'.

    Не удалось разрешить все зависимости для конфигурации ': app: _debugApkCopy'. Не удалось решить com.firebase: firebase-client-android: 2.5.2+. Требуется: проект: приложение: не указано Не удалось решить com.firebase: firebase-client-android: 2.5.2+. Не удалось отобразить версии для com.firebase: firebase-client-android. Невозможно загрузить метаданные Maven от https://jcenter.bintray.com/com/firebase/firebase-client-android/maven-metadata.xml. Не удалось GET 'https://jcenter.bintray.com/com/firebase/firebase-client-android/maven-metadata.xml'. jcenter.bintray.com

  • Try: Run с --stacktrace возможностью получения трассировки стека. Запустите с параметром --debug, чтобы получить больше выходных данных журнала.

как я могу решить эту проблему, пожалуйста, помогите ......

+0

Мне кажется, что град-кант признает эту библиотеку «com.firebase: firebase-client-android: 2.5.2+». Действительно ли это необходимо? Если нет, попробуйте удалить его зависимость, чтобы узнать, успешно ли построена –

ответ

0

заменить

compile 'com.firebase:firebase-client-android:2.5.2+' 

с

compile 'com.firebase:firebase-client-android:2.3.1' 

или

compile 'com.firebase:firebase-client-android:2.4.0' 
0

Похоже, вы наполовину используете Firebase 2.x (com.firebase ...) и наполовину используете Firebase 3.x (com.google.firebase ...

Возможно, эти два конфликтуют и вызывают ошибки?

https://firebase.google.com/support/guides/firebase-android должен помочь вам переключиться.

Смежные вопросы