相关疑难解决方法(0)

如何在应用程序中添加比库更多的构建类型

就像这里的例子一样,我正在扩展我的构建类型来添加staging:

android {
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            applicationIdSuffix '.debug'
        }
        staging {
            initWith release
            applicationIdSuffix '.staging'
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但我也有一个依赖:

implementation project(':mylibrary')
Run Code Online (Sandbox Code Playgroud)

编译失败,因为它不知道要配对staging的内容:mylibrary:

* What went wrong:
Could not determine the dependencies of task ':app:compileStagingJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:stagingCompileClasspath'.
   > Could not resolve project :mylibrary.
     Required by:
         project :app
      > Unable to find a matching configuration of project :mylibrary:
          - …
Run Code Online (Sandbox Code Playgroud)

android gradle

7
推荐指数
1
解决办法
1605
查看次数

标签 统计

android ×1

gradle ×1