Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Problems:Red Squiggly Lines Under Modules, No Emulator

I'm brand new to Android Studio and I've been having some problems getting it up and running. Have been working on this for the last 3 days alone with not much progress. When I launch a new project, no emulator appears and there are red squiggly lines under all of the modules. Here is a pic hosted on imgur:

https://i.imgur.com/P5I2DIO.jpg

I haven't been able to find any articles on these problems and none of the tutorials I've watched have said anything about extra steps to resolve them. I am posting them as a conjoined question because I suspect they are related problems. Thanks in advance for any guidance!

like image 557
gordon shumway Avatar asked Oct 30 '25 12:10

gordon shumway


2 Answers

This happened to me twice. Both because of mess in resources. No playing with caches invalidate gave result.

So:

First time when I looked into resource folders within File Explorer ... there were folders inside drawable folder!
Second time the layouts and strings xmls had wrong symbols when I imported the project in other encoding.

When first time, it showed app as red underlined one only. No caution no hint. And didnt point to any error and IDE builded aabs just ok

like image 191
CodeToLife Avatar answered Nov 01 '25 01:11

CodeToLife


"Red squiggly lines" indicate errors in your code. In this case, there's a problem with your R file. This is a file that Android generates to assign IDs to your resources.

Problems with the R file can be a number of things.

First, try:

Build -> Clean Project

If that doesn't work:

Make sure you have imported the R file of your project in the Java file of your activity. Try building the project to generate it.


If that doesn't work (this one is worth remembering):

There might be an error in one of your XML files. Look in the res folder and look for errors (red squiggly lines ;)!) in any of the files in the subfolders, fix any of these and the problem should resolve itself when R is regenerated.

like image 34
Karen Forde Avatar answered Nov 01 '25 03:11

Karen Forde