Solved: Android studio error that can discourage a beginner

Solved: Android studio error that can discourage a beginner

ยท

2 min read

So you wake up in the morning, feeling inspired to take on a new challenge of coding. You remembered you cloned a repo you found interesting a while back, and now you're ready to open the project to study the code base and apply your knowledge to it. On opening the project, you see the error below.

Error: Unfortunately you can't have non-Gradle Java modules and > Android-Gradle modules in one project

Android studio had other plans for you. You've not even touched the code, and all you see is red lines with the message above popping up in your IDE. You ask the question "did the code get stale because I had not touched it in a while?".

Worry no more because I've got a solution for you.

Step 1

click on

File > Invalidate Caches/Restart > Invalidate

Step 2

click on

File > Close Project

Step 3

Go to the Project folder and delete the .idea folder.

Step 4

Delete YourProjectName.iml file in the Project folder.

Step 5

Open Android studio > open existing project, and then select your project.

If the error still occurs,

Step 6

click on

Build > Rebuild Project

You're all set. If the error persists, visit this link to try out other solutions.

If you liked this guide,

  • Share with your friends ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป
  • React to the post ๐Ÿ˜๐Ÿฅณ๐Ÿ‘
  • Leave a comment if you have got other tips ๐Ÿ’ฌ