[英]I tried to connect my Android app to google firebase but it displays an error
I tried to connect my app to google firebase, I followed the procedure with implementation in Gradle as well as JSON file.我尝试将我的应用程序连接到 google firebase,我遵循了在 Gradle 和 JSON 文件中实现的过程。 After that, I tried to run my app and it displayed this error message:
之后,我尝试运行我的应用程序并显示此错误消息:
This is my Gradle file:这是我的 Gradle 文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
This is my other Gradle module:这是我的另一个 Gradle 模块:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.ius"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.google.firebase:firebase-auth:19.2.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.volley:volley:1.1.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
If you could help me that would mean the world to me.如果你能帮助我,那对我来说就意味着整个世界。 Thanks in advance :D
提前致谢
Some of your library has minSdk 16. So you must change your minSdkVersion to 16 or change library that compatibility with sdk 15.您的某些库具有 minSdk 16。因此您必须将 minSdkVersion 更改为 16 或更改与 sdk 15 兼容的库。
In your build.gradle(Module leve)在你的 build.gradle(Module 级别)
change minSdkVersion 15
to minSdkVersion 16
in defaultConfig
在
defaultConfig
中将minSdkVersion 15
更改为minSdkVersion 16
PS.附注。 Why you use minSDk is 16, I think use 21 still fine.
为什么你用minSDk是16,我觉得用21还是可以的。
在 defaultConfig 中将 minSdkVersion 从 15 更改为 16 可能会起作用......
decrease version library
减少版本库
implementation 'com.google.firebase:firebase-auth:16.0.5'实现 'com.google.firebase:firebase-auth:16.0.5'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.