前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >android 混合开发接入flutter

android 混合开发接入flutter

原创
作者头像
程序员小何SS
发布2022-01-04 20:28:56
6540
发布2022-01-04 20:28:56
举报
文章被收录于专栏:Android理论

flutter.gradle可在 flutter sdk中 /Users/wangyongbin/Documents/flutter/packages/flutter_tools/gradle 下的 flutter.gradle文件配置

代码语言:txt
复制
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知识

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档