AndroidStudio - Module Dependencies in Gradle

前端 未结 2 1717
走了就别回头了
走了就别回头了 2020-11-29 01:26

I have a little problem compiling an android application using module dependencies in Android Studio.

So, I want my application to use the library \'slidingmenu\' (l

相关标签:
2条回答
  • 2020-11-29 01:37

    For people using the gradle way (explicitly rather than being generated by the IDE):

    Add this to your app's build.gradle:

    dependencies {
        ....
        // other dependencies...
        implementation project(':module-name')
    }
    
    0 讨论(0)
  • 2020-11-29 01:49

    You should put your library modules inside the Application Project. In order to specify a module dependency, simply:

    1. Right click on Application->Open Module Settings
    2. Click on the '+' icon
    3. Select the root directory for your library module you'd like to add.
    4. Follow the prompts

    Then, this module will show up in your project. Then, you need to add it to Application as a library dependency. Once again, in your Module Settings:

    1. Select your Application module
    2. Select the Dependencies tab on the right
    3. Click the '+' icon on the bottom
    4. Select Module Dependency
    5. Select your desired library module
    0 讨论(0)
提交回复
热议问题