1.在{module}/build.gradle 中的 buildTypes中进行新增,比如我要新增一个 debugH5
buildTypes{
release {
//一些混淆规则 各种配置等
}
debug {
}
//下面这个是新增的
debugH5 {
}
}
2.在其他module中声明新增的buildTypes
有的module中完全没有buildTypes段落,就需要手动新增
buildTypes{
release {
//一些混淆规则 各种配置等
}
debug {
}
debugH5 {
//其他module中,该新增type的内容体可以为空
}
}
3.如果某个module中使用了canary相关的东西,需要把新增的buildTypes的引用方式也加上
debugImplementation 'com.github.markzhai:blockcanary-android:1.5.0'
releaseImplementation 'com.github.markzhai:blockcanary-android:1.5.0'
//比如上面两个声明是之前就有的
debugH5Implementation 'com.github.markzhai:blockcanary-android:1.5.0'
//那么在新增了 【debugH5】 这个buildTypes之后,就需要按照它的引用方式来声明,否则会报错