wjc
2025-04-09 afb62b49b79a31ab62a548f9cef672dfc9bae16f
build.gradle
@@ -2,6 +2,9 @@
buildscript {
    ext {
        agp_version = '4.1.3'
    }
    repositories {
        google()
        mavenCentral()
@@ -14,7 +17,7 @@
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.1.2"
        classpath "com.android.tools.build:gradle:$agp_version"
        classpath 'io.github.didi.dokit:dokitx-plugin:3.5.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
@@ -52,4 +55,17 @@
task clean(type: Delete) {
    delete rootProject.buildDir
}
// 保证dex_files文件中指定的文件都加载到Main Dex中
afterEvaluate {
    tasks.matching {
        it.name.startsWith('dex')
    }.each { dx ->
        if (dx.additionalParameters == null) {
            dx.additionalParameters = []
        }
        dx.additionalParameters += '--multi-dex'
        dx.additionalParameters += "--main-dex-list=$projectDir/dex_files".toString()
    }
}