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,这里不需要混淆,暂时关闭。

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

相关推荐
AA陈超几秒前
LyraRPG:001.创建RPGCore插件
c++·笔记·学习·ue5·虚幻引擎·lyra
汇能感知22 分钟前
摄像头模块在厨电领域的深度应用
经验分享·笔记·科技
AA陈超30 分钟前
Lyra学习6:GameFeatureAction_AddComponents分析
c++·笔记·学习·ue5
离离茶30 分钟前
【笔记2-8】ESP32:SmartConfig一键配网
笔记
影林握雪33 分钟前
M|大佛普拉斯 (2017)
经验分享·笔记·其他·生活
sheeta19981 小时前
LeetCode 每日一题笔记 日期:2025.12.02 题目:3623. 统计梯形的数目 I
笔记·算法·leetcode
松☆1 小时前
OpenHarmony 后台任务与 Flutter 生命周期协调:构建稳定可靠的混合应用
flutter
松☆1 小时前
Flutter 与 OpenHarmony 深度集成:自定义 MethodChannel 插件开发全指南
flutter·wpf
程序员东岸2 小时前
《数据结构——排序(上)》从扑克牌到分治法:插入排序与希尔排序的深度剖析
数据结构·笔记·算法·排序算法
克喵的水银蛇2 小时前
Flutter 布局实战:掌握 Row/Column/Flex 弹性布局
前端·javascript·flutter