Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android XML: "conflicts with another tag that has the same ID"

Tags:

I recently deleted a fragment including its layout and viewmodel from my project. (FragmentAddFlight, VmAddFlight, fragment_add_flight.xml)

Surprisingly I am getting these errors:

    [databinding] {"msg":"\u003cImageView id\u003d\u0027@+id/imageView2\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":277,"col0":20,"line1":286,"col1":85}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/textView4\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":308,"col0":28,"line1":312,"col1":64}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/editText8\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":314,"col0":28,"line1":318,"col1":60}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/textView5\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":327,"col0":28,"line1":331,"col1":63}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/textView14\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":333,"col0":28,"line1":338,"col1":57}]}
  [databinding] {"msg":"\u003cImageView id\u003d\u0027@+id/imageView2\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":369,"col0":20,"line1":378,"col1":72}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/textView4\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":400,"col0":28,"line1":404,"col1":60}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/editText8\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":406,"col0":28,"line1":410,"col1":60}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/textView5\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":419,"col0":28,"line1":423,"col1":71}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/textView14\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":425,"col0":28,"line1":430,"col1":57}]}
  [databinding] {"msg":"\u003cImageView id\u003d\u0027@+id/imageView2\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":452,"col0":20,"line1":461,"col1":77}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/textView4\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":483,"col0":28,"line1":487,"col1":60}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/editText8\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":489,"col0":28,"line1":493,"col1":60}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/textView5\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":502,"col0":28,"line1":506,"col1":71}]}
  [databinding] {"msg":"\u003cTextView id\u003d\u0027@+id/textView14\u0027\u003e conflicts with another tag that has the same ID","file":"C:\\Users\\Christoph\\Documents\\Android-Projekte\\FlightLogger\\app\\src\\main\\res\\layout\\fragment_add_flight.xml","pos":[{"line0":508,"col0":28,"line1":513,"col1":57}]}

Remember the file referenced in these error has already been deleted. Why do I get these errors?

I cleaned the project via Build -> clean project. I tried to rebuild the project via the same menu. But the result remains the same.

Does anybody have an idea how to solve this issue?

like image 614
Peter Avatar asked Sep 08 '19 10:09

Peter


People also ask

What is the use of XML tags in Android?

XML tags are not predefined in XML. We must define our own Tags. Xml as itself is well readable both by human and machine. Also, it is scalable and simple to develop. In Android we use xml for designing our layouts because xml is lightweight language so it doesn’t make our layout heavy.

What are the different XML files used in Android?

Different XML Files Used in Android: In Android there are several xml files used for several different purposes. Below we define each and every one. 1. Layout XML Files: Layout xml files are used to define the actual UI(User interface) of our application. It holds all the elements(views) or the tools that we want to use in our application.

What happens when you edit an XML file in Android Studio?

When editing an XML layout in Android Studio, code generation will be optimized to only update the binding object related to that XML file, and it will do so in memory to make things fast. This means that changes to the binding object are available immediately in the editor and you don’t have to wait for a full rebuild.

What is the use of color XML in Android Studio?

Color xml File (colors.xml): This file is used to define the color codes that we used in our app. We simply define the color’s in this file and used them in our app from this file. Location in Android Studio Below we show the colors.xml file in which we define green and white color.


2 Answers

These files are created at compile time, so they might not have been deleted, Try invalidate caches and restart in android studio.

like image 69
Anand Pandey Avatar answered Sep 22 '22 04:09

Anand Pandey


Invalidate Caches/Restart option sometime not working.

gradlew assembleDebug

Just try this command then see issue will no more available.

like image 29
Yogesh Rathi Avatar answered Sep 22 '22 04:09

Yogesh Rathi