I was building away with my application and all of the suden i got this error:
No resource identifier found for attribute 'linearLayoutOrientation' in package 'android'
I know where the error is created but i do not know how i can fix this. Can somone take a look and tell me what i am doeing wrong. I am building the application in Xamarin Studio.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffd8d8d8">
<TextView
android:id="#+id/Heading"
android:text="."
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ff0f62ae"
android:textSize="30dp"
android:textColor="#FFFFFFFF"
android:textStyle="bold"
android:padding="15dp" />
<EditText
android:id="#+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffffff"
android:height="40dp"
android:minHeight="40dp"
android:layout_marginRight="0.0dp"
android:linearLayoutOrientation="vertical" />
<View
android:layout_width="fill_parent"
android:layout_height="4.0dp"
android:id="#+id/separator"
android:visibility="visible"
android:background="#ff0b487f" />
<ListView
android:id="#+id/dataListView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#ff0f62ae" />
</LinearLayout>
Thanks in advance
remove
android:linearLayoutOrientation="vertical"
from edittext tag
and add
android:orientation="vertical"
in LinearLayout tag
remove android:linearLayoutOrientation="vertical"from editText from layout as you have provided it solve your issue in this context
Related
In Android Studio I have the following layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/entry_entry"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:paddingRight="4dip"
android:textSize="8pt"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="0dip"
android:layout_weight="0.42"
android:layout_height="wrap_content"
android:gravity="right">
<TextView
android:id="#+id/distance_entry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="2dip"
android:textSize="8pt"/>
<TextView
android:id="#+id/miles_entry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="2dip"
android:text="m"
android:textSize="7pt"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/folder_entry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dip"
android:textSize="6pt"/>
</LinearLayout>
<TextView
android:id="#+id/file_entry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="6pt"/>
</LinearLayout>
This layout is copied from an app that worked in Eclipse.
When I "Validate" the xml file I get the following errors:
Error:cvc-elt.1.a: Cannot find the declaration of element
'LinearLayout'.
Error:External resource http://schemas.android.com/apk/res/android is
not registered
Error:Premature end of file.
It seems that the answer will be to register the schema. How do I do that? (I have googled that question but not found an answer.)
There is no XML schema for layout resources. That is because there is an infinite number of element names (based on arbitrary Java classes) and an infinite number of attribute names.
On the whole, I am not aware of an XML schema for any Android resource type. Layouts are the type most resistant to having such a schema, though.
Hello I am starting with Android developing. I am just modifying with ECLIPSE an open source example. I have only modified strings.xml and some .png files. In the Android simulator it works perfect but when I try to generate the signed apk file I receive two errors with similar description. This is one of them (the line is marking with *):
Description #+id/about_us_desc_webview is not a sibling in the same RelativeLayout cc3x_about_us.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="#android:style/Theme.Black.NoTitleBar.Fullscreen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_background"
android:orientation="vertical" >
<include
android:id="#+id/cc3x_about_header_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="#layout/cc3x_headerlayout" />
<TextView
android:id="#+id/about_us_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/cc3x_about_header_view"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/about_title_label_top_margin"
android:text="#string/about_us_label"
android:textColor="#color/grey_text_color"
android:textSize="#dimen/extra_large_text_size"
android:textStyle="bold" />
<View
android:id="#+id/view1"
android:layout_width="fill_parent"
android:layout_height="#dimen/min_divider_height"
android:layout_below="#+id/about_us_textview"
android:layout_marginLeft="#dimen/about_title_label_side_margin"
android:layout_marginRight="#dimen/about_title_label_side_margin"
android:background="#drawable/about_page_divline" />
<WebView
android:id="#+id/about_us_desc_webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/view1"
android:layout_marginLeft="#dimen/about_title_label_side_margin"
android:layout_marginRight="#dimen/about_title_label_side_margin"
android:layout_marginTop="#dimen/min_margin_cutoff" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/about_us_desc_webview" >
<TextView
android:id="#+id/about_screen_contact_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
* android:layout_below="#+id/about_us_desc_webview"
android:layout_centerHorizontal="true"
android:text="#string/contact_label"
android:textColor="#color/grey_text_color"
android:textSize="25dip"
android:textStyle="bold" />
<View
android:id="#+id/divider_bottom"
android:layout_width="match_parent"
android:layout_height="#dimen/min_divider_height"
android:layout_below="#+id/about_screen_contact_label"
android:layout_marginLeft="#dimen/about_title_label_side_margin"
android:layout_marginRight="#dimen/about_title_label_side_margin"
android:background="#drawable/about_page_divline" />
<TextView
android:id="#+id/about_xcube_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/divider_bottom"
android:layout_margin="#dimen/max_margin_size"
android:autoLink="web"
android:text="#string/xcube_url"
android:textColor="#color/blue_text_color"
android:textColorLink="#color/blue_text_color"
android:textSize="10dip" />
<TextView
android:id="#+id/about_xcube_contact_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/divider_bottom"
android:layout_margin="#dimen/max_margin_size"
android:autoLink="email"
android:text="#string/xcube_contact_email"
android:textSize="#dimen/small_text_height" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/about_xcube_link"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="#string/about_xcube_address"
android:textColor="#color/grey_text_color"
android:textSize="#dimen/small_text_height" />
</RelativeLayout>
</RelativeLayout>
Any help will be apreciated. Thank you very much!!
The line
android:layout_below="#+id/about_us_desc_webview"
in your TextView is redundant. Since the RelativeLayout already has that attribute, it is useless. You can just erase that line and nothing should change.
And the reason it generates error is that, you can apply features such as below, above.. etc with an element in the same layout. Here "about_us_desc_webview" is out of the RelativeLayout and you cannot position something inside a RelativeLayout with something outside a RelativeLayout.
android:layout_below
Positions the top edge of this view below the given anchor view ID .
When Arise
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
android:id="#+id/rl_rootHeader"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/rl_Header"
android:layout_below="#+id/rl_rootHeader" // Arise ,In here RelativeLayout is Parent .
>
//
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:fillViewport="true"
android:id="#+id/scrollRoot"
android:background="#color/colorWhite"
>
</ScrollView>
Right Way
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
android:id="#+id/rl_rootHeader"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/rl_Header"
>
//
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:fillViewport="true"
android:id="#+id/scrollRoot"
android:background="#color/colorWhite"
android:layout_below="#+id/rl_rootHeader" // Call Here .This section is Child
>
</ScrollView>
In my case, The problem was with Kotlin Version. I updated the the Kotlin version and the problem "is not a sibling in the same RelativeLayout" resolved
Just remove the lines which are causing error from layout
.xml file
Try refreshing the layout
Your layout will probably change. You can now reset it properly.
If you go to Properties Panel you will see layout:alignComponent has some alignment shown as "Not Found". Just clear it out. In the above example Properties window -> textview -> layout:alignComponent check all alignment values.
Hi i have made this xml file but it is throwing some error : Incorrect line ending: found carriage return (\r) without corresponding newline (\n)
Here is my XML file :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/help_new_session"
android:layout_above="#+id/buttonHideNewSessionHelp"
/>
<Button
android:id="#+id/buttonHideNewSessionHelp"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:onClick="onButtonClick"
android:text="Hide" />
</RelativeLayout>
</LinearLayout>
The below process will resolve your issue.
Open layout file
Ctrl+Shift+F
Save the layout file and close it.
Delete any .out files the builder might have created(you can see .out files below the original layout file).
Clean project.
Try this layout Now
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/help_new_session"
android:layout_above="#+id/buttonHideNewSessionHelp"/>
<Button
android:id="#+id/buttonHideNewSessionHelp"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:onClick="onButtonClick"
android:text="Hide" />
</RelativeLayout>
</LinearLayout>
It is looking perfect
I use the same code of your not giving any problem to me.Select complete xml and use ctrl+i i will align and clean the project once
I saw so many answer of this question here but not one solve my problem. I am trying to make a tab layout I which there is text is text view in table layout and below table layout I want to add map. and I'm trying to do this but not get the result.
my error is
Failed to find style 'mapViewStylr' in current theme
after adding the MapView I got this error. and when I run the code on Nexus one and try to open the layout in which I added the MapView then the application Unfortunately stopped.
here is my layout code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#android:color/white"
>
<ScrollView
android:id="#+id/info_tab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<RelativeLayout
android:id="#+id/venuinfolayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#android:color/white" >
<TableLayout
android:id="#+id/venuetable"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:fitsSystemWindows="true"
android:weightSum="2"
>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="#+id/venueaddress"
android:text="Address:"
android:textColor="#android:color/black"
android:padding="6dip"
android:textStyle="bold"
android:textSize="20dip" />
<TextView
android:id="#+id/venueaddress_details"
android:layout_height="wrap_content"
android:layout_width="180dip"
android:singleLine="false"
android:layout_toRightOf="#id/venueaddress"
android:textColor="#android:color/black"
android:text="text"
android:layout_marginLeft="10dip"
android:padding="6dip"
android:textSize="15dip"
/>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="#+id/venuephone"
android:layout_below="#id/venueaddress"
android:text="Phone:"
android:textColor="#android:color/black"
android:padding="6dip"
android:textStyle="bold"
android:textSize="20dip" />
<TextView
android:id="#+id/venuephone_details"
android:layout_below="#id/venueaddress_details"
android:layout_toRightOf="#id/venuephone"
android:text="number"
android:textColor="#android:color/black"
android:layout_marginLeft="10dip"
android:padding="6dip"
android:textSize="15dip" />
</TableRow>
</TableLayout>
<com.google.android.maps.MapView
android:id="#+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/venuetable"
android:clickable="true"
android:apiKey="AIzaSyAvWazTUUQr88b_UqQvB4k5rPAtOhlxTFA" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
//try this it may help you
Add this into your manifest file
<uses-library android:name="com.google.android.maps" />
I had the same problem when I try to build a simple app, following the Android MapView tutorial.
The app showed this exception in AVD for the file file main.xml:
Failed to find style 'mapViewStyle' in current theme
At last I found that there is a mistake in file AndroidManifest.xml:
The element should be a child of the element, not immediately within .
Hope this was any help to you.
OR
look Here
I am a beginner coder trying to learn how to make android apps. I am using these tutorials and I guess I have ran into an error.
Here is my text.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="25dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<EditText
android:id="#+id/etCommands"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Type a command"
android:password="true" />
<LinearLayout
android:weightSum="100"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
<Button
android:layout_weight="20"
android:id="#+id/Bresults"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button" />
<ToggleButton
android:layout_weight="80"
android:id="#+id/tbPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="ToggleButton"
android:checked="true" />
</LinearLayout>
<TextView
android:id="#+id/tvresults"
android:paddingBottom="10dp"
android:checked="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="invalid" />
</LinearLayout>
I am getting an error next to where it says button. The error says:
Multiple annotations found at this line: - Element type "LinearLayout" must be followed by either attribute specifications, ">" or "/>". - error:error parsing XML:not well-formed (invalid token)"
You need to close the tag on your second Linear Layout >
<LinearLayout
android:weightSum="100"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"> <!-- here -->
The colorcoding in your post already highlights the issue. You forgot the > after the LinearLayout opening tag.
The IDE is complaining that your xml is not well-formed. If the IDE's errors are not clear enough, you try an online validator such as http://www.xmlvalidation.com/ .