Android layout XML errors









up vote
-1
down vote

favorite












I am new to Android Studio and I am getting errors for the following xml file:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:android:background="@color/graylight"
android:orientation="vertical">

<RelativeLayout

android:layout_width="match_parent"
android:layout_height="260dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="@drawable/jus" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">


</RelativeLayout>

<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_person_add_black_24dp" />


<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_message_black_24dp"/>
<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_grade_black_24dp"/>
</LinearLayout>



</android.support.constraint.ConstraintLayout>



Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:7: error: not well-formed (invalid token).



Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #1




How can I fix these errors?










share|improve this question























  • The error message says there is an error in "app/src/main/res/layout/activity_profile.xml" so please share this layout file (and since there seems to be an "invalid token" somewhere please make sure the snippet here is as exact a copy of your xml file as possible)
    – 0X0nosugar
    Nov 10 at 19:45










  • @0X0nosugar How can I upload the layout file?
    – Cassandra Campbell
    Nov 10 at 21:13











  • You can edit your own question (click on "edit" below the android tag). Then you can copy-paste the xml into the text area and format it as code. There is a small question mark in the top right corner of the text area if you need help with the markdown
    – 0X0nosugar
    Nov 10 at 21:19










  • @0X0nosugar It is not letting me indent the code. When I try to do so, it just keeps saying to re-paste the code I've already entered
    – Cassandra Campbell
    Nov 10 at 21:30










  • Then just paste the code into the text area and I'll try to edit it.
    – 0X0nosugar
    Nov 10 at 21:31














up vote
-1
down vote

favorite












I am new to Android Studio and I am getting errors for the following xml file:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:android:background="@color/graylight"
android:orientation="vertical">

<RelativeLayout

android:layout_width="match_parent"
android:layout_height="260dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="@drawable/jus" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">


</RelativeLayout>

<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_person_add_black_24dp" />


<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_message_black_24dp"/>
<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_grade_black_24dp"/>
</LinearLayout>



</android.support.constraint.ConstraintLayout>



Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:7: error: not well-formed (invalid token).



Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #1




How can I fix these errors?










share|improve this question























  • The error message says there is an error in "app/src/main/res/layout/activity_profile.xml" so please share this layout file (and since there seems to be an "invalid token" somewhere please make sure the snippet here is as exact a copy of your xml file as possible)
    – 0X0nosugar
    Nov 10 at 19:45










  • @0X0nosugar How can I upload the layout file?
    – Cassandra Campbell
    Nov 10 at 21:13











  • You can edit your own question (click on "edit" below the android tag). Then you can copy-paste the xml into the text area and format it as code. There is a small question mark in the top right corner of the text area if you need help with the markdown
    – 0X0nosugar
    Nov 10 at 21:19










  • @0X0nosugar It is not letting me indent the code. When I try to do so, it just keeps saying to re-paste the code I've already entered
    – Cassandra Campbell
    Nov 10 at 21:30










  • Then just paste the code into the text area and I'll try to edit it.
    – 0X0nosugar
    Nov 10 at 21:31












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I am new to Android Studio and I am getting errors for the following xml file:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:android:background="@color/graylight"
android:orientation="vertical">

<RelativeLayout

android:layout_width="match_parent"
android:layout_height="260dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="@drawable/jus" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">


</RelativeLayout>

<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_person_add_black_24dp" />


<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_message_black_24dp"/>
<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_grade_black_24dp"/>
</LinearLayout>



</android.support.constraint.ConstraintLayout>



Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:7: error: not well-formed (invalid token).



Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #1




How can I fix these errors?










share|improve this question















I am new to Android Studio and I am getting errors for the following xml file:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:android:background="@color/graylight"
android:orientation="vertical">

<RelativeLayout

android:layout_width="match_parent"
android:layout_height="260dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="@drawable/jus" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">


</RelativeLayout>

<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_person_add_black_24dp" />


<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_message_black_24dp"/>
<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_grade_black_24dp"/>
</LinearLayout>



</android.support.constraint.ConstraintLayout>



Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:7: error: not well-formed (invalid token).



Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #1




How can I fix these errors?







android






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 22:28









Marcin Orlowski

57k886119




57k886119










asked Nov 10 at 19:24









Cassandra Campbell

13




13











  • The error message says there is an error in "app/src/main/res/layout/activity_profile.xml" so please share this layout file (and since there seems to be an "invalid token" somewhere please make sure the snippet here is as exact a copy of your xml file as possible)
    – 0X0nosugar
    Nov 10 at 19:45










  • @0X0nosugar How can I upload the layout file?
    – Cassandra Campbell
    Nov 10 at 21:13











  • You can edit your own question (click on "edit" below the android tag). Then you can copy-paste the xml into the text area and format it as code. There is a small question mark in the top right corner of the text area if you need help with the markdown
    – 0X0nosugar
    Nov 10 at 21:19










  • @0X0nosugar It is not letting me indent the code. When I try to do so, it just keeps saying to re-paste the code I've already entered
    – Cassandra Campbell
    Nov 10 at 21:30










  • Then just paste the code into the text area and I'll try to edit it.
    – 0X0nosugar
    Nov 10 at 21:31
















  • The error message says there is an error in "app/src/main/res/layout/activity_profile.xml" so please share this layout file (and since there seems to be an "invalid token" somewhere please make sure the snippet here is as exact a copy of your xml file as possible)
    – 0X0nosugar
    Nov 10 at 19:45










  • @0X0nosugar How can I upload the layout file?
    – Cassandra Campbell
    Nov 10 at 21:13











  • You can edit your own question (click on "edit" below the android tag). Then you can copy-paste the xml into the text area and format it as code. There is a small question mark in the top right corner of the text area if you need help with the markdown
    – 0X0nosugar
    Nov 10 at 21:19










  • @0X0nosugar It is not letting me indent the code. When I try to do so, it just keeps saying to re-paste the code I've already entered
    – Cassandra Campbell
    Nov 10 at 21:30










  • Then just paste the code into the text area and I'll try to edit it.
    – 0X0nosugar
    Nov 10 at 21:31















The error message says there is an error in "app/src/main/res/layout/activity_profile.xml" so please share this layout file (and since there seems to be an "invalid token" somewhere please make sure the snippet here is as exact a copy of your xml file as possible)
– 0X0nosugar
Nov 10 at 19:45




The error message says there is an error in "app/src/main/res/layout/activity_profile.xml" so please share this layout file (and since there seems to be an "invalid token" somewhere please make sure the snippet here is as exact a copy of your xml file as possible)
– 0X0nosugar
Nov 10 at 19:45












@0X0nosugar How can I upload the layout file?
– Cassandra Campbell
Nov 10 at 21:13





@0X0nosugar How can I upload the layout file?
– Cassandra Campbell
Nov 10 at 21:13













You can edit your own question (click on "edit" below the android tag). Then you can copy-paste the xml into the text area and format it as code. There is a small question mark in the top right corner of the text area if you need help with the markdown
– 0X0nosugar
Nov 10 at 21:19




You can edit your own question (click on "edit" below the android tag). Then you can copy-paste the xml into the text area and format it as code. There is a small question mark in the top right corner of the text area if you need help with the markdown
– 0X0nosugar
Nov 10 at 21:19












@0X0nosugar It is not letting me indent the code. When I try to do so, it just keeps saying to re-paste the code I've already entered
– Cassandra Campbell
Nov 10 at 21:30




@0X0nosugar It is not letting me indent the code. When I try to do so, it just keeps saying to re-paste the code I've already entered
– Cassandra Campbell
Nov 10 at 21:30












Then just paste the code into the text area and I'll try to edit it.
– 0X0nosugar
Nov 10 at 21:31




Then just paste the code into the text area and I'll try to edit it.
– 0X0nosugar
Nov 10 at 21:31












1 Answer
1






active

oldest

votes

















up vote
2
down vote













At your xml file, at line 7 you are repeating "android" twice:



android:android:background="@color/graylight"


should be:



android:background="@color/graylight"


In addition in line 48:
You need to provide orientation to your LienarLayout view such as vertical or horizontal.





Also, last line needs to be removed:



</android.support.constraint.ConstraintLayout>


Your root view is LinearLayout.



Edit your xml as follow:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/graylight"
android:orientation="vertical">

<RelativeLayout

android:layout_width="match_parent"
android:layout_height="260dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="@drawable/jus" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>
</RelativeLayout>

<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_person_add_black_24dp" />


<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_message_black_24dp"/>
<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_grade_black_24dp"/>
</LinearLayout>


In your last change your closing view didn't match the openning one.






share|improve this answer






















  • Thanks for catching that. I just fixed that.
    – Cassandra Campbell
    Nov 10 at 22:21










  • You're welcome :)
    – HaroldSer
    Nov 10 at 22:22










  • Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:48: error: mismatched tag.
    – Cassandra Campbell
    Nov 10 at 22:24











  • Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug
    – Cassandra Campbell
    Nov 10 at 22:25










  • Your LinearLayout needs an orientation. See my updated response.
    – HaroldSer
    Nov 10 at 22:25










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242618%2fandroid-layout-xml-errors%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













At your xml file, at line 7 you are repeating "android" twice:



android:android:background="@color/graylight"


should be:



android:background="@color/graylight"


In addition in line 48:
You need to provide orientation to your LienarLayout view such as vertical or horizontal.





Also, last line needs to be removed:



</android.support.constraint.ConstraintLayout>


Your root view is LinearLayout.



Edit your xml as follow:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/graylight"
android:orientation="vertical">

<RelativeLayout

android:layout_width="match_parent"
android:layout_height="260dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="@drawable/jus" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>
</RelativeLayout>

<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_person_add_black_24dp" />


<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_message_black_24dp"/>
<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_grade_black_24dp"/>
</LinearLayout>


In your last change your closing view didn't match the openning one.






share|improve this answer






















  • Thanks for catching that. I just fixed that.
    – Cassandra Campbell
    Nov 10 at 22:21










  • You're welcome :)
    – HaroldSer
    Nov 10 at 22:22










  • Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:48: error: mismatched tag.
    – Cassandra Campbell
    Nov 10 at 22:24











  • Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug
    – Cassandra Campbell
    Nov 10 at 22:25










  • Your LinearLayout needs an orientation. See my updated response.
    – HaroldSer
    Nov 10 at 22:25














up vote
2
down vote













At your xml file, at line 7 you are repeating "android" twice:



android:android:background="@color/graylight"


should be:



android:background="@color/graylight"


In addition in line 48:
You need to provide orientation to your LienarLayout view such as vertical or horizontal.





Also, last line needs to be removed:



</android.support.constraint.ConstraintLayout>


Your root view is LinearLayout.



Edit your xml as follow:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/graylight"
android:orientation="vertical">

<RelativeLayout

android:layout_width="match_parent"
android:layout_height="260dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="@drawable/jus" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>
</RelativeLayout>

<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_person_add_black_24dp" />


<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_message_black_24dp"/>
<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_grade_black_24dp"/>
</LinearLayout>


In your last change your closing view didn't match the openning one.






share|improve this answer






















  • Thanks for catching that. I just fixed that.
    – Cassandra Campbell
    Nov 10 at 22:21










  • You're welcome :)
    – HaroldSer
    Nov 10 at 22:22










  • Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:48: error: mismatched tag.
    – Cassandra Campbell
    Nov 10 at 22:24











  • Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug
    – Cassandra Campbell
    Nov 10 at 22:25










  • Your LinearLayout needs an orientation. See my updated response.
    – HaroldSer
    Nov 10 at 22:25












up vote
2
down vote










up vote
2
down vote









At your xml file, at line 7 you are repeating "android" twice:



android:android:background="@color/graylight"


should be:



android:background="@color/graylight"


In addition in line 48:
You need to provide orientation to your LienarLayout view such as vertical or horizontal.





Also, last line needs to be removed:



</android.support.constraint.ConstraintLayout>


Your root view is LinearLayout.



Edit your xml as follow:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/graylight"
android:orientation="vertical">

<RelativeLayout

android:layout_width="match_parent"
android:layout_height="260dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="@drawable/jus" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>
</RelativeLayout>

<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_person_add_black_24dp" />


<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_message_black_24dp"/>
<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_grade_black_24dp"/>
</LinearLayout>


In your last change your closing view didn't match the openning one.






share|improve this answer














At your xml file, at line 7 you are repeating "android" twice:



android:android:background="@color/graylight"


should be:



android:background="@color/graylight"


In addition in line 48:
You need to provide orientation to your LienarLayout view such as vertical or horizontal.





Also, last line needs to be removed:



</android.support.constraint.ConstraintLayout>


Your root view is LinearLayout.



Edit your xml as follow:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/graylight"
android:orientation="vertical">

<RelativeLayout

android:layout_width="match_parent"
android:layout_height="260dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="@drawable/jus" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>
</RelativeLayout>

<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_person_add_black_24dp" />


<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_message_black_24dp"/>
<ImageView
android:layout_width="425dp"
android:layout_height="85dp"
android:src="@drawable/ic_grade_black_24dp"/>
</LinearLayout>


In your last change your closing view didn't match the openning one.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 10 at 22:37

























answered Nov 10 at 21:59









HaroldSer

1,2762615




1,2762615











  • Thanks for catching that. I just fixed that.
    – Cassandra Campbell
    Nov 10 at 22:21










  • You're welcome :)
    – HaroldSer
    Nov 10 at 22:22










  • Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:48: error: mismatched tag.
    – Cassandra Campbell
    Nov 10 at 22:24











  • Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug
    – Cassandra Campbell
    Nov 10 at 22:25










  • Your LinearLayout needs an orientation. See my updated response.
    – HaroldSer
    Nov 10 at 22:25
















  • Thanks for catching that. I just fixed that.
    – Cassandra Campbell
    Nov 10 at 22:21










  • You're welcome :)
    – HaroldSer
    Nov 10 at 22:22










  • Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:48: error: mismatched tag.
    – Cassandra Campbell
    Nov 10 at 22:24











  • Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug
    – Cassandra Campbell
    Nov 10 at 22:25










  • Your LinearLayout needs an orientation. See my updated response.
    – HaroldSer
    Nov 10 at 22:25















Thanks for catching that. I just fixed that.
– Cassandra Campbell
Nov 10 at 22:21




Thanks for catching that. I just fixed that.
– Cassandra Campbell
Nov 10 at 22:21












You're welcome :)
– HaroldSer
Nov 10 at 22:22




You're welcome :)
– HaroldSer
Nov 10 at 22:22












Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:48: error: mismatched tag.
– Cassandra Campbell
Nov 10 at 22:24





Android resource compilation failed Output: /Users/cassandracampbell/AndroidStudioProjects/Profile/app/src/main/res/layout/activity_profile.xml:48: error: mismatched tag.
– Cassandra Campbell
Nov 10 at 22:24













Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug
– Cassandra Campbell
Nov 10 at 22:25




Command: /Users/cassandracampbell/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/554c09d4342abb7d275bb8bd5da525f8/aapt2-3.2.1-4818971-osx/aapt2 compile --legacy -o /Users/cassandracampbell/AndroidStudioProjects/Profile/app/build/intermediates/res/merged/debug
– Cassandra Campbell
Nov 10 at 22:25












Your LinearLayout needs an orientation. See my updated response.
– HaroldSer
Nov 10 at 22:25




Your LinearLayout needs an orientation. See my updated response.
– HaroldSer
Nov 10 at 22:25

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242618%2fandroid-layout-xml-errors%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

政党