Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FirebaseAnalytics.getInstance showing warning but compiles successfully

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:

enter image description here

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.

enter image description here

like image 646
kirtan403 Avatar asked Nov 08 '16 13:11

kirtan403


1 Answers

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

like image 156
Ognian Gloushkov Avatar answered Oct 21 '22 15:10

Ognian Gloushkov