0

I did something wrong and I don't know what I did. But the module name has been changed to my-android-app.

And I am trying to get it back to app. The default name of single module.

I tried Rename Module. But I get.

in the drop down menu of build, there are my-android-app and app. But I just have one build.gradle of module from my-android-app.

In the project structure. I just have my-android-app. Nothing to delete.

How can I fix this problem?

c-an
  • 3,543
  • 5
  • 35
  • 82
  • take a backup of existing project, now Project Structure dialog can be accessed from "File -> Project Structure" or by right click on a Module and selecting "Module Settings". there select the delete (-) option, now it will not be treated as module – SHASHI SHEKHAR Barnwal Oct 15 '19 at 04:44
  • @SHASHISHEKHARBarnwal I just have `my-android-app` in the project structure. – c-an Oct 15 '19 at 05:41

1 Answers1

0
  1. You need to rename *.iml file(IntelliJ IDEA Module). This is the name of module. This file describes about the module.

  2. Edit configuration if you see two.

enter image description here

  1. Delete all except for app. And change Name to app if its name is different.

enter image description here

  1. .idea >your-app.iml`
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/app/your-app.iml" filepath="$PROJECT_DIR$/app/your-app.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
    </modules>
  </component>
</project>
  1. Delete one of them. (Maybe your-app.iml module tags.) Or if the location is incorrect then fix it.
  2. File > Invalidate Caches & Restart.
  3. Clean Build.
c-an
  • 3,543
  • 5
  • 35
  • 82