質問編集履歴
1
不要な文言を削除、編集したファイルのコードを追記しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,36 +1,134 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
FlutterでFirebaseに接続したい
|
3
3
|
|
4
|
-
ここに質問の内容を詳しく書いてください。
|
5
|
-
(例)PHP(CakePHP)で●●なシステムを作っています。
|
6
|
-
■■な機能を実装中に以下のエラーメッセージが発生しました。
|
7
|
-
|
8
|
-
### 発生している問題・エラーメッセージ
|
9
|
-
|
10
4
|
```
|
11
5
|
エラーメッセージ
|
12
|
-
```
|
13
6
|
Launching lib/main.dart on iPhone 11 in debug mode...
|
14
7
|
Running Xcode build...
|
15
8
|
Xcode build done. 37.9s
|
16
9
|
6.26.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
|
17
10
|
Debug service listening on ws://127.0.0.1:50553/FUUe4n7K3Gc=/ws
|
18
11
|
Syncing files to device iPhone 11...
|
12
|
+
```
|
19
13
|
|
14
|
+
【android/build.gradle】
|
15
|
+
```buildscript {
|
20
|
-
|
16
|
+
repositories {
|
17
|
+
google()
|
18
|
+
jcenter()
|
19
|
+
}
|
21
20
|
|
21
|
+
dependencies {
|
22
|
+
classpath 'com.android.tools.build:gradle:3.5.0'
|
23
|
+
classpath 'com.google.gms:google-services:4.3.3'
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
22
|
-
|
27
|
+
allprojects {
|
28
|
+
repositories {
|
23
|
-
|
29
|
+
google()
|
30
|
+
jcenter()
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
rootProject.buildDir = '../build'
|
35
|
+
subprojects {
|
36
|
+
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
37
|
+
}
|
38
|
+
subprojects {
|
39
|
+
project.evaluationDependsOn(':app')
|
40
|
+
}
|
41
|
+
|
42
|
+
task clean(type: Delete) {
|
43
|
+
delete rootProject.buildDir
|
44
|
+
}
|
24
45
|
```
|
25
46
|
|
47
|
+
【app/build.gradle】
|
48
|
+
```ここに言語を入力
|
49
|
+
def localProperties = new Properties()
|
50
|
+
def localPropertiesFile = rootProject.file('local.properties')
|
51
|
+
if (localPropertiesFile.exists()) {
|
52
|
+
localPropertiesFile.withReader('UTF-8') { reader ->
|
53
|
+
localProperties.load(reader)
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
58
|
+
if (flutterRoot == null) {
|
59
|
+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
60
|
+
}
|
61
|
+
|
62
|
+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
63
|
+
if (flutterVersionCode == null) {
|
64
|
+
flutterVersionCode = '1'
|
65
|
+
}
|
66
|
+
|
67
|
+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
68
|
+
if (flutterVersionName == null) {
|
69
|
+
flutterVersionName = '1.0'
|
70
|
+
}
|
71
|
+
|
72
|
+
apply plugin: 'com.android.application'
|
73
|
+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
74
|
+
|
75
|
+
android {
|
76
|
+
compileSdkVersion 28
|
77
|
+
|
78
|
+
lintOptions {
|
79
|
+
disable 'InvalidPackage'
|
80
|
+
}
|
81
|
+
|
82
|
+
defaultConfig {
|
83
|
+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
84
|
+
applicationId "com.${Username}.test_fb"
|
85
|
+
minSdkVersion 16
|
86
|
+
targetSdkVersion 28
|
87
|
+
versionCode flutterVersionCode.toInteger()
|
88
|
+
versionName flutterVersionName
|
89
|
+
multiDexEnabled true
|
90
|
+
}
|
91
|
+
|
92
|
+
buildTypes {
|
93
|
+
release {
|
94
|
+
// TODO: Add your own signing config for the release build.
|
95
|
+
// Signing with the debug keys for now, so `flutter run --release` works.
|
96
|
+
signingConfig signingConfigs.debug
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
flutter {
|
102
|
+
source '../..'
|
103
|
+
}
|
104
|
+
|
105
|
+
dependencies {
|
106
|
+
// ...
|
107
|
+
implementation 'com.google.firebase:firebase-core:17.0.0'
|
108
|
+
implementation 'androidx.multidex:multidex:2.0.0'
|
109
|
+
|
110
|
+
// Getting a "Could not find" error? Make sure that you've added
|
111
|
+
// Google's Maven repository to your root-level build.gradle file
|
112
|
+
}
|
113
|
+
|
114
|
+
apply plugin: 'com.google.gms.google-services'
|
115
|
+
|
116
|
+
```
|
117
|
+
|
26
118
|
### 試したこと
|
27
119
|
Udemyのflutter講座を真似して、Firebaseにプロジェクトを作成して、Android,iOSそれぞれで
|
28
120
|
gradleファイルの編集、Google-serviceファイルの追加など行った後、ビルドしたんですが、
|
29
121
|
6.26.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
|
30
122
|
というメッセージが出てくるのですが原因がよくわからず詰まっているので、なにをすればよいのか教えていただきたいです。
|
31
123
|
|
124
|
+
iOSの方は
|
125
|
+
ios/Runner.xcodeprojを展開後、
|
126
|
+
GoogleService-Info.plistをRunner/Runnner配下に置きましたがエラーがでます。
|
32
|
-
|
127
|
+
ご回答にて下記のQiitaの記事のとおりにやっておりましたが、上記のエラーが出る次第です。
|
128
|
+
https://qiita.com/emono/items/036568ddb5712b039855
|
33
129
|
|
130
|
+
Androidの方は、
|
34
|
-
|
131
|
+
gradleファイルを上記コードの通りFirebaseの指示の通りに編集しました。
|
35
132
|
|
133
|
+
|
36
|
-
|
134
|
+
### 補足情報(FW/ツールのバージョンなど)
|