Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

293
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda