gradle可在 flutter sdk中 /Users/wangyongbin/Documents/flutter/packages/flutter_tools/gradle 下的 flutter.gradle文件配置
project.android.buildTypes {
// Add profile build type.
profile {
initWith debug
if (it.hasProperty("matchingFallbacks")) {
matchingFallbacks = ["debug", "release"]
}
}
// TODO(garyq): Shrinking is only false for multi apk split aot builds, where shrinking is not allowed yet.
// This limitation has been removed experimentally in gradle plugin version 4.2, so we can remove
// this check when we upgrade to 4.2+ gradle. Currently, deferred components apps may see
// increased app size due to this.
if (shouldShrinkResources(project)) {
release {
// Enables code shrinking, obfuscation, and optimization for only
// your project's release build type.
minifyEnabled true
// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
// NOTE: The resource shrinker can't be used for libraries.
shrinkResources isBuiltAsApp(project)
// Fallback to `android/app/proguard-rules.pro`.
// This way, custom Proguard rules can be configured as needed.
proguardFiles project.android.getDefaultProguardFile("proguard-android.txt"), flutterProguardRules, "proguard-rules.pro"
}
}
//====================自定义构建多模块,多衍生版==============================
debug131 {
initWith debug
minifyEnabled false //混淆
proguardFiles project.android.getDefaultProguardFile("proguard-android.txt"), flutterProguardRules, "proguard-rules.pro"
}
pre_1.initWith(debug131)
pre_1 {}
release_debug.initWith(debug131)
release_debug {}
release {
minifyEnabled false
proguardFiles project.android.getDefaultProguardFile("proguard-android.txt"), flutterProguardRules, "proguard-rules.pro"
}
release_new.initWith(release)
release_new {}
//====================自定义构建多模块,多衍生版==============================
}
-----------------------------------
android 混合开发接入flutter