Firebase 不能';在VScode中向渐变添加依赖性后不同步
我试图配置我的颤振项目,以便使用firebase。我添加了所有依赖项,在将firebase中提到的行添加到Gradle构建后无法同步。 如何在vscode中同步 增加了对firebase的依赖性:Firebase 不能';在VScode中向渐变添加依赖性后不同步,firebase,flutter,dart,Firebase,Flutter,Dart,我试图配置我的颤振项目,以便使用firebase。我添加了所有依赖项,在将firebase中提到的行添加到Gradle构建后无法同步。 如何在vscode中同步 增加了对firebase的依赖性: apply plugin: 'com.google.gms.google-services' dependencies { classpath 'com.android.tools.build:gradle:3.2.1' **classpath 'com.googl
apply plugin: 'com.google.gms.google-services'
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
**classpath 'com.google.gms:google-services:4.3.3'**
}
在project->android->app->build.gradle:
apply plugin: 'com.google.gms.google-services'
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
**classpath 'com.google.gms:google-services:4.3.3'**
}
在project->gradle->build.gradle:
apply plugin: 'com.google.gms.google-services'
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
**classpath 'com.google.gms:google-services:4.3.3'**
}
在项目->公共规范yaml中
firebase_auth: ^0.14.0+5
还运行了flatter pub get
错误日志:
apply plugin: 'com.google.gms.google-services'
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
**classpath 'com.google.gms:google-services:4.3.3'**
}
使用Firebase时,您需要下载
google services.json
文件并将其添加到您的项目中:
然后在android/build.gradle中,您需要添加google()maven存储库:
buildscript {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
...
// Add this line
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
...
}
}
在android\app\build.gradle
中,您需要添加google服务
插件:
apply plugin: 'com.google.gms.google-services'
选中此项:
添加ur build.gradle和pubspec.yamlI,正如firebase文档中所说的那样。我该如何同步它们?我的意思是将它们添加到问题中,以查看问题是如何添加的。。。!!!!在android studio中,右上角将弹出窗口,打开android studio中的android模块并同步文件。但是在VScode中我该怎么做呢?是的,因为你使用的是flatter,那么pubspec.yaml相当于原生android开发中的build.gradle,当你在pubspec.yaml中添加一个依赖项并保存它时,它将自动获得该依赖项,但是,再次按照添加firebase的步骤来确保一切都是正确的,并且不要忘记使用minSdkVersion 21而不是minSdkVersion 16错误日志是我得到的完整错误,它在questionWorks中提到:)我弄乱了firebase和google服务版本。