Android Studio导入model

  1. 修改被导入的项目的build.gradle
apply plugin: 'com.android.library'

删掉applicationId 

修改为 libraryVariants
//配置自定义打包名称
    libraryVariants.all { variant ->
        variant.outputs.all {
            def fileName
            ...
        }
    }


  1. 打开要导入的项目
    1. 选择New Model

    2. 选择Import Gradle project

    3. 点击next

    4. 选择项目目录

  2. 在项目的build.gradle中添加implementation project(':demo'),demo是被引入的项目的名字
原文地址:https://www.cnblogs.com/charlottepl/p/14113513.html