当我将 firebase 连接到 android studio 上的 flutter 项目时,我收到此错误,我已经完成了他们在 firebase 安装部分中提到的所有设置
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Cannot resolve external dependency com.google.gms:google-services:4.4.1 because no repositories are defined.
Required by:
project :
这是因为,buildscript{} 中没有存储库列表。
您可以通过从 allprojects{} 复制存储库列表并将其粘贴到 buildscript{} 中来解决此问题。
以下是解决此问题的方法,
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.4.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}