Skip to main content
 首页 » 编程设计

android-studio之Android Studio之如何在子目录中制作模块

2025年04月02日24kerrycode

假设我有 3 个模块:mod1、mod2 和 mod3。

在正常情况下,文件系统层次结构应该是:

[android_root_dir] 
build.gradle # list this file just to make it clear. 
----mod1 
----mod2 
----mod3 

但我想要的是:
[android_root_dir] 
build.gradle # list this file just to make it clear. 
----modules 
    ----mod1 
    ----mod2 
    ----mod3 

如何在 Android Studio 1.1.0 中做到这一点?

PS:我找到这篇文章但它似乎不起作用,或者它适用于早期版本的 AS,而不是 1.1.0:
How can I move a module inside a subdirectory?

请您参考如下方法:

你能行的:

root 
  build.gradle 
  settings.gradle 
  modules 
    mod1 
      build.gradle 
    mod2 
      build.gradle 
    mod3 
      build.gradle 

在您的 settings.gradle
include ':modules:mod1' , ':modules:mod2', ':modules:mod3'