首页 > 解决方案 > 为什么当我尝试将 firebase 添加到我的 Android 项目时会发生此错误?

问题描述

我尝试在这里使用我的代码 https://i.stack.imgur.com/WcbeT.png

           // I tried these solution and doesn't work 

   //  1. remove the

            implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
        //    and add only

            implementation 'com.google.firebase:firebase-database:16.0.1'

    //      2.
            allprojects {
              repositories {
               google()
               maven { url "https://maven.google.com" }
             }
            }

标签: androidfirebasekotlin

解决方案


将以下依赖项添加到您的应用程序 gradle(根据您的需要进行更新):

实施 'com.google.firebase:firebase-core:xxx'

刚刚检查了您提供的屏幕截图,此行末尾有额外的内容 删除它,您就可以开始了::15.0.0

在此处输入图像描述


推荐阅读