Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'name' attribute should be defined - error in android manifest

Tags:

android

In my android project manifest, Android Studio gives an inspection error in a android:uses-permission element. But app successfully compiles.

enter image description here

enter image description here What is the meaning of this inspection? How can I correct it?

like image 622
Lahiru Chandima Avatar asked May 02 '15 14:05

Lahiru Chandima


People also ask

What is Android name in manifest file?

Every app project must have an AndroidManifest. xml file (with precisely that name) at the root of the project source set. The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.

What is Android name attribute?

The name attribute is used to specify the Fragment class that is used to create the View hierarchy - in this case myFragment.

What is manifest permission in android?

The Android manifest file helps to declare the permissions that an app must have to access data from other apps. The Android manifest file also specifies the app's package name that helps the Android SDK while building the app.


2 Answers

You can see the error based on first three lines. Delete android: part from line. Write:

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

instead of:

<android:uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
like image 66
Aleksandar Avatar answered Sep 23 '22 00:09

Aleksandar


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

This also works

like image 25
Kamal Avatar answered Sep 23 '22 00:09

Kamal