[android] Android Studio not showing modules in project structure

I am using Android studio and I want to add module to my project like "action bar Sherlock" or jar files, but when I opened the project structure there is no module or library in the menu :\

In intelij it's appearing:

enter image description here

So what's the problem? How can I add these modules in Android studio?

This question is related to android module android-studio project-structure

The answer is


If you moved the modules, modify your workspace.xml file and settings.gradle file to use the new paths of your module. Otherwise you will need to try using the import module feature.


You need to add a gradle.settings file to your root project structure, after that when you "Open Module settings" you will the menu aligned to your gradle.settings. When importing a project to Android Studio, it doesn't create this file for you. Sometimes it's usually better to start a clean project and move your code there, it's usually easier to achieve.


This Might be help some:

To import module as library in your project.

  1. File > New > Import Module
  2. Select Valid path in Source Dir..
  3. Tick on Import > Finish

Now Open Module setting:

  1. Go to File > Project Structure > Modules
  2. Modules > Dependency > click on Green Plus Sign.
  3. Click on Module Dependency > locate module > and Implement your module.

if your module is not shown in "Choose Modules Window"

Follow the below step..

  1. Open Settings.Gradle file
  2. include ':app', 'Put your module name here' and sync project.

Follow Open Module Setting as above.


Go to File->Project Structure-> Project Settings -> Modules.

Click on the green colored + and add new module. select Application module and set the content root to your project module.

Click next and then finish.

Reference


Open settings.gradle and add the module as below,

include ':app',':bottomnav'

here i have added my newly imported module ':bottomnav' separated with a comma. then Sync your project. your module will be visible to dependency. Android Studio only displays those module, which are defined in the settings.gradle file of your application. after defining the module in settings.gradle, you will be able to add the module as dependency of your application.


Check settings.gradle. You'll find this : include ':app'

Just add your own module name and it should look like this :

include ':app', ':yourModuleName'

Sync.

That's it.


Update 19 March 2019

A new experience someone has just faced recently even though he/she did add a library module in app module, and include in Setting gradle as described below. One more thing worth trying is to make sure your app module and your library module have the same compileSdkVersion (which is in each its gradle)!

Please follow this link for more details.

Ref: Imported module in Android Studio can't find imported class

Original answer

Sometimes you use import module function, then the module does appear in Project mode but not in Android mode

enter image description here

enter image description here So the thing works for me is to go to Setting gradle, add my module manually, and sync a gradle again:

enter image description here


Had similar issue when running version control on a project in Android Studio (0.4.2). When pulling it down to a new location and importing the modules, only the "Android SDK" were showing in the Project Structure.

I removed the .idea/ folder from the version control, by adding it to .gitignore file, and did a fresh pull and imported the modules. Now all the settings appeared correctly in the Project Settings and Platform Settings for the Project Structure.


Here's what I did to solve this problem

  • Close Android Studio
  • Quick Start -> Check out from Version Control

I had the same problem, after switching to a branch that did not have my module, then switching back.

Clean Project -> Rebuild Project did not work for me.

But File -> Invalidate caches/restart did work.


Make sure the directory name is lower case.


Do right mouse click on your project, then select 'Open Module Settings' - then you can add modules to your project..


As for me issue was that the first line in the build.gradle file of the OpenCV library.

It was something like this: apply plugin: 'com.android.application' This refers to the fact that the imported OpenCV is an application and not a library. It exists for OpenCV above 4.1.0. So change it to: Something like this: apply plugin: 'com.android.library'.

You might get an error in ApplicationId, comment it out in the gradle file.


First You Have To Add Name Of Your Module In setting.gradle(Project Setting) File Like This..

include ':app', ':simple-crop-image-lib'

Then You Need To Compile This Module Into build.gradle(Module app) File Like This..

implementation project(':simple-crop-image-lib')

That's all for adding module now it will be appear in android  section or project section as well.

If It's till did't appear rebuild or clean your project..

First, create your Module. You can do that using the default Android Studio Module Wizard (File -> New -> New Module), select Android Library, give it a Name and a package name, and finish. After that you will see that nothing happens. Open the side Gradle Projects Section (should be somewhere on the right panel)

You should see something like this:

enter image description here

Expand your module gradle and run the Run Configurations task. After that refresh the content and refresh the project structure.

It should work now.


Please go to Module settings and choose Modules from Project Settings then you need to Select src and gen folders and marked them as Source folders by right-click on them and select Source


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to module

How to fix: fatal error: openssl/opensslv.h: No such file or directory in RedHat 7 How to import functions from different js file in a Vue+webpack+vue-loader project Typescript ReferenceError: exports is not defined ImportError: No module named tensorflow ModuleNotFoundError: What does it mean __main__ is not a package? ES6 modules in the browser: Uncaught SyntaxError: Unexpected token import module.exports vs. export default in Node.js and ES6 What's the difference between an Angular component and module Export multiple classes in ES6 modules Python - Module Not Found

Examples related to android-studio

A failure occurred while executing com.android.build.gradle.internal.tasks "Failed to install the following Android SDK packages as some licences have not been accepted" error Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' Flutter plugin not installed error;. When running flutter doctor ADB.exe is obsolete and has serious performance problems Android design support library for API 28 (P) not working Flutter command not found How to find the path of Flutter SDK

Examples related to project-structure

Package name does not correspond to the file path - IntelliJ Best practice for Django project working directory structure Representing Directory & File Structure in Markdown Syntax Android Studio not showing modules in project structure Find a class somewhere inside dozens of JAR files? What is the best project structure for a Python application?