简体   繁体   English

我试图将我的 Android 应用程序连接到 google firebase,但它显示一个错误

[英]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提前致谢

Change your minSdkVersion 15 to minSdkVersion 16将您的minSdkVersion 15更改为minSdkVersion 16

As the Docs stated that正如文档所说

Make sure that your app meets the following requirements: Targets API level 16 (Jelly Bean) or later确保您的应用满足以下要求:目标 API 级别 16 (Jelly Bean) 或更高版本

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 defaultConfigdefaultConfig中将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.

相关问题 我试图将我的 flutter 应用程序与 firebase 连接起来,但我遇到了这个错误 - I tried to connect my flutter app with firebase and I catch up with this error 我试图在我的Android应用中使用JSON连接到我的Web服务,但出现了以下错误: - I tried to connect to my web service using JSON in my android app, but I got this error: 我尝试将android和wamp连接起来作为我的应用程序的登录界面。 我没有得到输出 - I have tried to connect android and wamp for login interface for my app. I not getting the output 我尝试将我的 Android 项目与 Firebase 连接,但 JSON 文件错误即将到来 - I tried connecting my Android project with Firebase but JSON file error is coming 如何将我的 Android 应用程序连接到谷歌驱动器? - How can i connect my Android app to google drive? 我正在尝试将 firebase 云消息连接到 android 应用程序。 应用未加载错误“找不到 com.google.firbase:firebase-core:17.0.1”。 - i am trying to connect firebase cloud messaging to android app. app is not loading the error "Could not find com.google.firbase:firebase-core:17.0.1." 如何将我已经链接的 android 应用程序的谷歌 firebase 更改为另一个谷歌 firebase? - How can I change the google firebase of my already linked android app, to another google firebase? 如果我的 android 本机应用程序中有多个模块,如何连接 firebase - How to connect firebase if I have multiple modules in my android native app 当我尝试在android studio中运行我的应用程序时出现此错误。 有谁知道如何解决这个问题? - I got this error when I tried to run my app in android studio. Does anyone know how to solve this problem? 将Firebase添加到我的Android应用程序时发生Gradle错误 - Gradle error on adding firebase to my Android App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM