Why is the source code 'all red' in Android Studio

社会主义新天地 提交于 2019-12-04 07:57:30

Try file -> invalidate caches / restart -> Invalidate caches and restart

Sync Gradle and Rebuild Project.

Possible Fixes:

  1. Sync Gradle
  2. Restart Android Studio
  3. Clean and Rebuild

A Possible other problem that can occur is that you moved the location of the file. Its happened to me before.

When you have a red code like the image is because the autogenerate files and de gradle its not working well.

I try this options in order:

First, Check de import and be sure are the rigth imports

Second, Sync Gradle and Rebuild Project.

Third, Clean project

If the problem persist try checking the android dependencies and see which one is creating the problem.

Try deleting .gradle and .idea folder of project. For me its solved the problem.

Just removing .idea or at least files inside of it, even if while you're opening Android Studio a popup alert will be shown to tell you to reload your project and it everything will go back normally

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!