0

When trying to use xmlns:app="http://schemas.android.com/apk/res-auto" in any XML file of my project, it appears to be grayed out, and when I hover over it, I get "Namespace declaration is never used. Checks for unused namespace declarations and location hints in XML."

I am led to believe this is why when trying to implement AdView, I get an error saying "Namespace 'ads' is not bound."

Any help would be appreciated.

0

2 Answers 2

1

It doesn't really matter what name you call to your namespace. You can name it anything you want as long as you refer to it with the same name.

So for example, just change

xmlns:app="http://schemas.android.com/apk/res-auto" 

to

xmlns:ads="http://schemas.android.com/apk/res-auto" 

because you already referred to ads namespace in your AdView.

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect mate! Fixed instantly! Cheers!
0

The XML name-spaces s.a. xmlns:app="http://schemas.android.com/apk/res-auto" have nothing to do with how your app appears or operates. The way the name-spaces are set is defined by the convention, however you can easily delete, or put something like this instead: xmlns:app="asdasdasdasd" and it will still work just perfectly.

Meaning of the name-space being greyed out is that it's there are several references to the same component.

What is important, is the xmlns:app part, which specifies where it has been referred to, so the solution might be to change the referable to xmlns:ads or just add an namespace which starts with xmlns:ads.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.