Problem Appeared : When i have open my XML file and changing the layout_height attribut.
Problem description : Suspicious namespace: should start with http://
Line problem* :
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pj="http://schemas.android.com/apk/res/com.example"
xmlns:bm="com.example" <!-- problem line -->
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:background="#drawable/basic"
android:orientation="vertical" >
If you need a custom namespace, use the Android auto-namespace feature.
In your example:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto" />
Clean your project and if the problem persist restart your IDE
Related
I don't understand what is the error. The IDE gives me an error at 2 line:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
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"
tools:context="dreamer.dareyou.HomeActivity">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
</android.support.design.widget.CoordinatorLayout>
Like Mohsen said, you need to remove the space you have between xmlns: and android. Your third and fourth lines should look like this:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
This is the .xml file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:seekarc="http://schemas.android.com/apk/res/com.pelkinsoft.enpower"
android:layout_width="match_parent"
android:layout_height="match_parent" >
The errors occur at:
<com.triggertrap.seekarc.SeekArc
android:id="#+id/seekArc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="30dp"
seekarc:progressColor="#color/arc_color"
seekarc:rotation="180"
seekarc:startAngle="30"
seekarc:sweepAngle="300"
seekarc:touchInside="true" />
I am new to Android and this is keeping me from being able to effectively work on this app. Any help would be much appreciated.
You must add the Seek Arc library (https://github.com/neild001/SeekArc#adding-to-your-project) to your project
Inside res foder, create following file:
res/values/color.xml
Then, define the color used by SeekArc view:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="arc_color">#0000FF</color>
</resources>
OR
Manually set the color in the SeekArk view:
<com.triggertrap.seekarc.SeekArc
android:id="#+id/seekArc"
android:layout_width="match_parent"
....
seekarc:progressColor="#0000FF"
....
/>
I am starting out with Xamarin studio, I have build most basic forms project. In tutorials it shows how to edit layout in Main.xml, that is supposed to be in Resources/layout that is missing in my solution. So when I add it manually it then fails with error message The layout contains malformed XML and another one Root element is missing. When I opened the Main.xml in notepad I can see contents to be <?xml version="1.0" encoding="UTF-8" ?>.
How do contents of proper blank Main.xml supposed to be like?
Review that the markups are start and close correctly; for example,
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:background="#drawable/fondomizzou" **/>**
NOT
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:background="#drawable/fondomizzou"
**</RelativeLayout> />**
Figured it out myself
Click on source, then add
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
and that should do it.
I Googled my problem but I can't find a solution.
When I try to create a signed APK, I get this error:
Error:(6) Error: Suspicious namespace and prefix combination [NamespaceTypo]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Explanation for issues of type "NamespaceTypo":
track these down.
xmlns:app="http://schemas.android.com/tools"
obscure error messages. This check looks for potential misspellings to help
Accidental misspellings in namespace declarations can lead to some very
This is the fragment of this layout file:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/tools"
app:layout_behavior="#null"
android:layout_gravity="bottom|right">
change the code xmlns:app="http://schemas.android.com/tools" with this:
xmlns:app="http://schemas.android.com/apk/res-auto"
It made mine work.
Your first two lines of the xml code are incorrect. The whole xml file should look as follows:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/tools"
app:layout_behavior="#null"
android:layout_gravity="bottom|right">
The first 2 lines are the declaration of the xml file. Although you are able to view the actual layout of the page in the design view, the layout itslef would still have issues when being built since it needs the xml tools tag.
The purpose of this namespace is to be able to record information in XML files, and have that information stripped when the application is packaged such that there is no runtime or download size penalty. It is a dedicated Android XML namespace.
Hope this helps :)
The tools namespace should be used for the preview tools of the xml on android studio. For example, if you are testing a view that is hidden by default, but you want to see it on your preview you should use tools:visibility=visible.
The app namespace, as far as I know, is used to add your custom views and layouts to the namespace of the xml you want to add your views.
So all your answers are correct, but I think no one explained what the namespaces do. So for convention I recommend to use them like this:
xmlns:yourAppName="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
I had this same error. My problem was that Android Studio automatically put an xmlns into my layout tab instead of the root view tag when using data binding.
In other words when I have Android Studio resolve the app prefix it did this:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/tools"> <!-- added namespace here ... -->
<data>
<variable
name="viewModel"
type="com.example.ViewModel"/>
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="..."
android:layout_height="..."
android:orientation="vertical"
app:backgroundResource="#{viewModel.someResource}"> <!-- ... when trying to resolve app -->
...
when it should have done this:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:custom="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
type="com.example.ViewModel"/>
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools" <!-- should have added here -->
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="..."
android:layout_height="..."
android:orientation="vertical"
app:backgroundResource="#{viewModel.someResource}">
...
change the attributes of tools in parent layout work for me like below**
xmlns:app="http://schemas.android.com/tools"
change this to the below
xmlns:app="http://schemas.android.com/apk/res-auto"
I'am trying to load a spinner to my layout and keep geting this error:
The following classes could not be found:
- Spinner (Change to android.widget.Spinner, Fix Build Path, Edit XML)
heres my xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Spinner
android:id="#+id/spn_dates"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="displayDatesToSpiner" />
<ListView
android:id="#+id/LST_bought_products"
android:layout_width="match_parent"
android:layout_height="302dp" >
</ListView>
</LinearLayout>
Thanks
This sometimes happens when you rename the standard AppTheme in your android manifest. It will build and deploy just fine, but the xml design editor won't render it.
This is usually because there's an invalid attribute somewhere.
Remove the onClick and it will work.