Android Studio not showing modules in project structure

后端 未结 16 959
醉酒成梦
醉酒成梦 2020-12-29 17:58

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 lib

相关标签:
16条回答
  • 2020-12-29 18:37

    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.

    0 讨论(0)
  • 2020-12-29 18:37
    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..
    
    0 讨论(0)
  • 2020-12-29 18:38

    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:

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

    It should work now.

    0 讨论(0)
  • 2020-12-29 18:39

    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.

    0 讨论(0)
  • 2020-12-29 18:40

    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

    0 讨论(0)
  • 2020-12-29 18:42

    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.

    0 讨论(0)
提交回复
热议问题