android - 在 Android Studio 中连接到 Firebase 的 Gradle 的当前版本是什么?

标签 android firebase android-studio gradle build.gradle

我正在考虑在 android studio 上创建一个应用程序,目前,我正在创建它的登录部分。我正在观看有关如何执行此操作的教程,并按照所有说明进行操作,但它在 build.gradle(模块:app)文件中给了我一个关于连接到 Firebase 以通过电子邮件和密码对用户进行身份验证的错误。我认为该错误与以下代码行中的版本号有关:
应用插件:'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion "29.0.3"

defaultConfig {
    applicationId "com.example.simplysnap"
    minSdkVersion 15
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
}
dependencies {

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:28.0.0'
//The two lines below have the errors
implementation 'android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:design:1.1.0'
// Until here
implementation 'androidx.support:support-v7:28.0.0'
implementation 'androidx.support:design:28.0.0'
implementation 'androidx.constraintlayout:constraintlayout:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:28.0.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.google.http-client:google-http-client-gson:1.22.0'

}
尝试使用电子邮件和密码连接到 Firebase 身份验证时遇到的错误是:
无法解析 Android 应用程序模块的 Gradle 配置。解决 gradle 构建问题和/或重新同步。
这两行的最新版本是什么:
实现'android.support:appcompat-v7:28.0.0'
实现 'androidx.appcompat:design:1.1.0'
语法是否正确?
提前致谢!

最佳答案

这是将 android 项目与 firebase 连接的链接,只需按照链接中指导的步骤操作即可
确保您在 firebase 控制台中添加了 sha1,您可以按照此链接步骤获取 sh1
https://stackoverflow.com/a/34223470/5309463
https://firebase.google.com/docs/android/setup
实现'android.support:appcompat-v7:28.0.0'
改用这个
实现'androidx.legacy:legacy-support-v4:1.0.0'
使用这个等级

    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.api-client:google-api-client:1.22.0'
    implementation 'com.google.http-client:google-http-client-gson:1.22.0'

关于android - 在 Android Studio 中连接到 Firebase 的 Gradle 的当前版本是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62527133/

相关文章:

android - 电池电量状态 (0x2A1B) 蓝牙规范是什么意思?

android - 如何使用 FCM (Firebase Cloud Messaging) 制作紧凑的通知?

ios - swift 函数不返回字符串?

android - 无法下载 kotlin-compiler-embeddable.jar

java - 强制调用父类(super class)方法,并在 list 文件中未添加权限时给出错误

android - Firebase 数据更新滞后 - 多人游戏

android - 在 Android Studio 中 Gradle 构建需要很长时间才能完成

git - 如果我选择其他分支与Android Studio 3.3.4中的Git merge 会发生什么?

android - 如何通过处理程序从 IntentService 多次调用 WebView Activity ?

swift firebase 嵌套子项计数