FirebaseAnalytics.getInstance showing warning but compiles successfully

南笙酒味 提交于 2020-12-26 05:19:21

问题


When I write code about firebase analytics like FirebaseAnalytics.getInstance() I get a warning message:

Missing permissions required by FirebaseAnalytics.getInstance: android.permission.ACCESS_NETWORK_STATE and android.permission.WAKE_LOCK

Here is the screenshot:

I didn't found anything about this by googling.

I also tried cleaning and rebuilding my project. Restarting Android studio. Nothing worked.

What's the issue?

Edit: Permissions are there. I can see those in the merged manifest. But still gives the error.


回答1:


Add

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

to your Manifest file

Android Studio doesn't look in imported lib's manifests. It's just an IDE error. You can disable the inspection



来源:https://stackoverflow.com/questions/40487832/firebaseanalytics-getinstance-showing-warning-but-compiles-successfully

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!