One set of code is compatible with multiple APKs

### 1. Establish the same directory system and write different codes in directories with the same structure.
Insert image description here

2. Add in the build code

flavorDimensions "channel"
productFlavors {
    
    
    di5fse {
    
    
        applicationId "com.byd.ambientlight"
        versionCode 1
        versionName "1.0.0"
        manifestPlaceholders = [APP_CHANNEL_VALUE: "di5fse"]
        // dimension 用于标识该产品风味属于 channel 这个风味维度
        dimension "channel"
    }
    di6fse {
    
    
        applicationId "com.byd.ambientlight"
        versionCode 2
        versionName "1.0.0"
        manifestPlaceholders = [APP_CHANNEL_VALUE: "di6fse"]
        dimension "channel"
    }
}

3. Build apk selection

Insert image description here

Guess you like

Origin blog.csdn.net/qq_32670947/article/details/129694498