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!
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
"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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With