android - 无法解决:firebase-auth-15.0.0。火力基地错误
问题描述
我正在尝试将 firebase 连接到我的应用程序。按“向您的应用程序添加 firebase 身份验证”后,我收到以下错误:“无法解决:firebase-auth-15.0.0”这导致我在 build.gradle(module:app) 中的依赖项。错误:
implementation 'com.android.support:appcompat-v7:28.0.0'
有关错误的详细信息:
所有 com.android.support 库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到版本 28.0.0、26.1.0。例子包括 com.android.support:animated-vector-drawable:28.0.0 和 com.android.support:support-media-compat:26.1.0 less... (Ctrl+F1) 有一些库的组合,或者不兼容或可能导致错误的工具和库。一种这样的不兼容性是使用不是最新版本的 Android 支持库版本(或者特别是低于您的 targetSdkVersion 的版本)进行编译。问题 ID:GradleCompatible
我的整个依赖项:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
}
解决方案
在您的根级 build.gradle 中:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.2.0' // google-services plugin
}
}
allprojects {
// ...
repositories {
// ...
google() // Google's Maven repository
}
}
在您的模块 build.gradle 中:
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.0.5'
// Getting a "Could not find" error? Make sure you have
// added the Google maven respository to your root build.gradle
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
推荐阅读
- git - github上的SSH项目给出问题
- c - DLL 导出不带 DEF 文件的 __stdcall 并使用 VS 修饰函数名
- android - 华为地图不加载瓷砖
- python-3.x - 芹菜任务和python函数一起调试
- python - 由 Crontab 运行时,Python 脚本无法按预期工作
- reactjs - 如何在 React js 中提交表单?
- javascript - html,head和body元素之间的父子关系?
- spring-boot - 单点登录重定向不适用于 Spring Security Oauth
- android - 在智能 pos 打印机上反应原生包的工作
- javascript - 使用下一个构建时缩小 React 错误 #321,但能够使用 npm run build 成功构建