・2022/09/19
Androidで Firebaseの Realtime Databaseを使う方法、公式の手順だとエラーしか出ない罠
(Firebase Realtime Databaseを Androidアプリに組み込む方法)
Tags: [Android開発]
● Androidで Firebaseの Realtime Databaseを使う方法、公式の手順だとエラーしか出ない罠
Firebase Realtime Databaseを Androidアプリに組み込む方法
Firebase ドキュメント - Realtime Database
Firebase ドキュメント - Android 向け Firebase
project-root/build.gradle
buildscript {
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
dependencies {
...
// Add the dependency for the Google services Gradle plugin
classpath 'com.google.gms:google-services:4.3.13'
}
}
allprojects {
...
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
}
公式の手順だとエラーしか出ない罠。
The Google Services Gradle Plugin
project-root/build.gradle
dependencies {
classpath 'com.google.gms:google-services:4.3.14'
// ...
}
この手順だとエラーしか出ない罠。
Google Services Gradle Plugin
app/build.gradle
plugins {
id 'com.android.application'
// Add the Google services Gradle plugin
id 'com.google.gms.google-services' version '4.3.2'
}
この手順で組み込めました。
2022年 9月現在は 4.3.14が最新っぽい
app/build.gradle
plugins {
id 'com.android.application'
// Add the Google services Gradle plugin
id 'com.google.gms.google-services' version '4.3.14'
}
● app/build.gradleの dependencies
app/build.gradle
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:30.3.1')
// Declare the dependency for the Realtime Database library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-database'
}
● Firebaseの Realtime Databaseは AndroidManifest.xmlに INTERNET権限の宣言は不要
Firebaseの Realtime Databaseはネットワーク通信を使いますが、AndroidManifest.xmlに INTERNET権限の宣言は不要です。
<uses-permission android:name="android.permission.INTERNET" />
Tags: [Android開発]
●関連するコンテンツ(この記事を読んだ人は、次の記事も読んでいます)
Androidで DBのフレームワーク SQLDelightを使う方法、公式の手順だとエラーしか出ない罠
SQLDelightを Androidで使う方法
Androidで Twitter4Jを使って Twitterのユーザー タイムラインを丸っと取得する方法
Twitter4Jの Java ラッパでまるっと取得!ユーザーアカウントでのログインが必要
Androidの公式 Twitterライブラリで Twitterのユーザー タイムラインを丸っと取得する方法
Twitter Kit for Androidでまるっと取得!ユーザーアカウントでのログイン不要
.NET C#の Tweetinviライブラリで Twitterの投稿内容を投稿画像込みで丸っと取得する方法
まるっと取得したかった!質問は受け付けない!
Pythonの Tweepyライブラリで Twitterの投稿内容を投稿画像込みで丸っと取得する方法
まるっと取得したかった!質問は受け付けない!
ちいかわの単行本を買ってみた!もちろん特装版!
特装版のカルタが怖いと話題のちいかわ単行本。
すみっコぐらし サンエックスの人気キャラクター お菓子のキッシュシュクレ(タルト)、フィナンシェ
すみっコぐらしshop東京駅店 東京キャラクターストリート 東京駅一番街に行ってみた
【全集中の呼吸】鬼滅の刃の食玩お菓子を買ったら報告するスレ、オマケシール集め【鬼殺隊】
【全買占め】「鬼滅の刃」ブームに乗っかって鬼滅のお菓子を根こそぎ買い占め、これは戦争だ【在庫滅殺】
【我が道を】遂にガチの食玩にも手を出してしまった。。。Re:ゼロから始める異世界生活ウエハース vol.3【突き進むのみ】
【レムは俺の嫁】レムが主役のアニメ、リゼロ【エミリアは脇役】
テレビアニメ ご注文はうさぎですか? 通称「ごちうさ」のフィギュアを買ったのでレビュー
ごちうさのスペシャル フィギュア チノ リゼ シャロを買ったのでレビュー、UFOキャッチャー景品
[HOME]
|
[BACK]
リンクフリー(連絡不要、ただしトップページ以外は Web構成の変更で移動する場合があります)
Copyright (c)
2022 FREE WING,Y.Sakamoto
Powered by 猫屋敷工房 & HTML Generator
http://www.neko.ne.jp/~freewing/android/android_firebase_realtime_database/