我正在尝试将Firebase Auth添加到我的Android应用程序中。当我运行应用程序时,我收到以下错误消息:
我已经尝试过更新Flutter、Dart和AndroidStudio。这是我的build.gradle(根目录)的一小段代码:
这是来自
最后,这是我的
我还将
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.google.gms.google-services:4.3.15:.
Required by:
project :
我已经尝试过更新Flutter、Dart和AndroidStudio。这是我的build.gradle(根目录)的一小段代码:
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms.google-services:4.3.15'
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
这是来自
build.gradle
(模块)的一小段代码。buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms.google-services:4.3.15'
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
最后,这是我的
pubspec.yaml
文件:name: app_layout
description: A new Flutter project.
publish_to:
version: 1.0.0+1
environment:
sdk: '>=2.19.6 <3.0.0'
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
http: ^1.0.0
firebase_core: ^2.13.1
firebase_auth: ^4.6.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:
uses-material-design: true
assets:
- assets/
我还将
google-service.json
添加到应用程序目录中。