2017-05-17 13 views
0

私はAndroidベースのアプリケーションでFirebaseリアルタイムのデータベースを使用しています。Firebaseリアルタイムデータベースに関する問題

Iは以下のようにdependecy使用した:内部

:(build.gradle :)

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.2.0' 
compile 'com.android.support:design:25.0.0' 
compile "com.google.firebase:firebase-auth:9.0.2" 

//compile 'com.google.firebase:firebase-core:10.2.1' 
//compile 'com.google.firebase:firebase-database:10.2.1' 

testCompile 'junit:junit:4.12' 

} するプラグインを適用する: 'com.google.gms.google-サービス'

そしてアプリケーションレベルのグラデルファイルの中で私は使った:

dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.3' 
    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 
} 

私はクラスses:DatabaseReferenceおよびFirebaseDatabase

しかし、どちらのクラスも見つかりませんでした。 依存関係はありませんか?

Pls。教えてください。ありがとう。

答えて

1

この行をbuild.gradleファイルに追加する必要があります。

compile 'com.google.firebase:firebase-database:9.0.2' 

しかし、あなたは最後のバージョンを使用しています。 FirebaseUIをご覧ください。

希望します。

+0

whoo ..ありがとうございます。 –

+0

はい、5月17日9:55に解決済み –

0

この行をbuild.gradleファイルに追加する必要があります。

build.gradle 
dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.0' 
     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 
    } 

アプリ/ build.gradle

dependencies { 
     // Adding support library for this demo app 
     compile 'com.android.support:design:24.2.1' 

     compile 'com.google.firebase:firebase-database:9.6.1' 
    } 

    apply plugin: 'com.google.gms.google-services' 

それがお役に立てば幸いです。

0

あなたはAndroidがFireBase用に構築されたプラグインではありですFireBaseを使用する場合のGradleが欠落しているかわからない場合は、このbuild.gradle

compile 'com.google.firebase:firebase-database:9.2.1' 
compile 'com.google.firebase:firebase-auth:9.2.1' 
1

を追加する必要があります。 手順:(ツール) - >(Firebase)FireBaseをクリックして右右サイドメニューを開くFirebase Auth、Firebase Storage、Firebaseデータベースのようにすべてのオプションを利用できます。それから、全体的なステップがあります。接続するファイアベースの場合

関連する問題