Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why AndroidStudio shows warning "Namespace declaration is never used"?

This is my layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
</LinearLayout>

Taked from the android official training

In the second line, AndroidStudio shows this warning:

Namespace declaration is never used

Why this happens?

Thank you.

like image 780
androidevil Avatar asked Nov 17 '13 22:11

androidevil


1 Answers

This is because you don't have anything with tools namespace actually declared in your xml.

Look at the android namespace, you have 3 elements with that namespace, but none for tools.

The namespace tools (http://schemas.android.com/tools) is used for the GUI designer and is not used for running apps on Android devices so you can safely remove it.

like image 176
Szymon Avatar answered Oct 03 '22 12:10

Szymon