Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
Android Studio Open Wrong File When Trying to Open XML layout file

I am using android studio 3.3, my project is using kotlin 1.3.20 with build gradle 3.3.0

however when i try to open xml file, it open different file with the right file name and the right file path:

enter image description here

And when i try to see this xml file in my Git, my file is normal

enter image description here

when i try to run this project, it run with no problem at all. i already try to invalidate caches/restart but the problem still exist.

this error affecting random xml files. some of my xml layout files open my kotlin file. some of them open auto generated file

please help.... is this something to do with error indexing? how can i fix this?

UPDATE :

found someone who might have the same problem with this, in google issue tracker : https://issuetracker.google.com/issues/122988154

UPDATE 2 :

this issue is not just happen in xml file but also in kotlin file.

i try to open my activity file, but it open one of data binding generated classes

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

So Apparently this issue is bug in Android Studio. after do some research, this bug might be happen not just to xml layout but other xml file too such as resource like dimens, strings, style etc..

finally there is some workaround for this issue that work without reinstall Android Studio. Thank you @ChetanJoshi for the suggestion in the comment section.

Steps:

  • Copy the error xml file to somewhere in your PC directory (as backup file)
  • Delete the error xml file, if there is dialog file usage appear klik delete anyway
  • Copy the backup file and paste it back to where it was deleted
  • Run your project. it should run
  • If you are using Data Binding and there is error appear about auto generated data binding class, Clean Project then rebuild project. if the error still appear try to invalidate caches/restart, rebuild project then run the project
over 4 years ago · Santiago Trujillo Report

0

  • Restart your Android Studio, if not working, Restart your PC. or
  • Go to plugins -> Android support and disable this. Restart Android studio and enable the plugin again

After that don't forget to Refresh your Gradle project.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!