Unable to build feature modules in a multi-flavor app

前端 未结 3 1545
清酒与你
清酒与你 2021-01-18 11:00

I am using Gradle 4.4 with Gradle-Android plugin 3.1.1 on Android Studio 3.1.1.

I have 2 flavors \'a\' and \'b\' and I am unable to build my project due to the follo

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-18 11:57

    FWIW you don't have to have matching flavors in your modules. You can tell it to fallback to the default build types.

    By using matchingFallbacks

    buildTypes {
        aDebug {
            testCoverageEnabled true
            matchingFallbacks = ['debug']
        }
        bDebug {
            testCoverageEnabled true
            matchingFallbacks = ['debug']
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            // This one already looks for 'release' which is added by default, so no need for fallback
        }
    }
    

    https://developer.android.com/studio/build/dependencies#resolve_matching_errors

提交回复
热议问题