Android Studio - 无法解析符号“firebase” [英] Android Studio - Cannot resolve symbol 'firebase'

查看:319
本文介绍了Android Studio - 无法解析符号“firebase”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在将应用升级到新的Firebase版本。我遵循指南,在我的项目build.gradle和<$ c的依赖关系中包含 classpath'com.google.gms:google-services:3.0.0' $ c> compile'c​​om.google.firebase:firebase-core:9.0.1'在我的模块build.gradle的依赖关系中,还有 apply plugin:'com .google.gms.google-services'在该文件的末尾。



我得到一个无法解析符号'firebase'我的导入,即 import com.google.firebase.database.DatabaseReference; 。这些都不是构建时出现的错误,所以这似乎是工作,但它们在Android Studio的代码编辑器中可见。



导入工作很好,一对夫妇(除了正在维护的FirebaseAuth之外)。从那时起,我没有改变任何代码(除了试图升级到9.0.2,导致相同的结果)。我做的唯一的事情就是更新Android SDK的一些组件,但是我不记得是哪一个。 Android SDK以及Google存储库和Google Play服务都是最新版本。

任何想法如何解决这个问题?

解决方案

.firebase:firebase-client-android:2.5.0'


I'm currently upgrading an app to the new Firebase version. I followed the guide, included classpath 'com.google.gms:google-services:3.0.0' in the dependencies of my project build.gradle as well as compile 'com.google.firebase:firebase-core:9.0.1' among others in the dependencies of my module build.gradle and also apply plugin: 'com.google.gms.google-services' at the end of that file.

I get a "cannot resolve symbol 'firebase'" in my imports i.e. import com.google.firebase.database.DatabaseReference;. Those are not errors that appear when building, so this seems to be working, but they are visible in the code editor of Android Studio.

The imports worked just fine a couple of days ago (except for FirebaseAuth, which was under maintenance). I did not change anything about the code since then (except trying to upgrade to 9.0.2, which lead to the same result). The only thing I did was update some components of the Android SDK, but I can't remember which. The Android SDK as well as Google Repository and Google Play Services are of the newest version. Rebuilding, cleaning and invalidate caches / restart had no effect.

Any ideas how to fix this?

解决方案

You need to add this dependency in your build.gradle(app)

compile 'com.firebase:firebase-client-android:2.5.0'

这篇关于Android Studio - 无法解析符号“firebase”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆