flutter开发实战-混淆minifyEnabled及shrinkResources

flutter开发实战-混淆minifyEnabled及shrinkResources

最近开发中,出现了在Debug模式下完全正常,打包build后出现插件代码调用提示未实现。

No implementation found for method login on channel app_plugin

经过查找发现在build apk时候出现了混淆的问题,下面把这个功能关掉

一、调整android/app/build.gradle

找到build.gradle,我们这里关闭minifyEnabled与shrinkResources

复制代码
android {
    compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.flutter_app"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion 21
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            minifyEnabled false
            shrinkResources false
        }
    }
}

二、总结

flutter开发实战-混淆minifyEnabled及shrinkResources,这里不需要混淆,暂时关闭。

学习记录,每天不停进步。

相关推荐
可爱系程序猿3 小时前
佳能 MF645Cx Windows 11 驱动下载安装:UFR II 队列可打印但扫描入口缺失的排查
程序人生·电脑·1024程序员节
lll23526917794 小时前
2026行业语音转写工具专业术语转写功能横向分析
笔记·智能手机
irislinAmelia6 小时前
缺陷检测AI关键点在哪
人工智能·嵌入式硬件·1024程序员节
Ai-_Man6 小时前
Meta Muse还是不可以导出左侧所有对话,只能点进去单条内容导出,方法不对吗?
开发语言·人工智能·ai·小程序·c#·1024程序员节
梓豪csd6 小时前
消息订阅中心:谁该收到哪条通知
java·开发语言·人工智能·低代码·自动化·1024程序员节
王中阳Go6 小时前
两个入口答案不一致先别调模型:6 行入口口径对账表(附脚本)
人工智能·后端·python·大语言模型·1024程序员节
Yang96116 小时前
0.8米超短盲区,解析BM-T1如何服务矿石能源光缆测试
1024程序员节
BK贝壳6 小时前
bool-hybrid-array 落盘我只认 .bha:用 Create_BHA / Ask_BHA 做布尔数组序列化
数据结构·python·numpy·1024程序员节
by209996 小时前
Linux 基础指令与文件操作
linux·1024程序员节
老徐聊GEO6 小时前
长尾问法召回对比实验(2026):全国大词与“南京+行业“问法的差异测量
1024程序员节·geo优化