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

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

相关推荐
●VON2 小时前
鸿蒙Flutter实战:分类管理页BottomSheet CRUD
数据库·flutter·华为·harmonyos·鸿蒙
鹏北海-RemHusband5 小时前
Go 语言进阶笔记 — 面向 JS/TS 前端开发者
笔记·golang
woodWu6 小时前
Flutter 复杂拖拽排序实战:同源排序 + 跨容器拖拽完整落地
flutter
nnsix6 小时前
Unity QFramework ResKit、UIKit 笔记
笔记
小小小小小鹿6 小时前
Vibe Coding 实战:Flutter 自定义路径布局
flutter·vibecoding
摇滚侠7 小时前
Java 零基础全套教程,反射机制,笔记 187-188
java·开发语言·笔记
【云轩】7 小时前
如何设计一台能模拟电机的电子负载:一个硬件工程师的实战笔记
笔记·嵌入式硬件
可信计算9 小时前
X司民用无人机运行安全与合规培训手册
笔记
李子琪。9 小时前
Web漏洞-CSRF-CSRF防御 实验步骤
经验分享·笔记
程序员老刘10 小时前
Dart 3.12 更新要点:乏善可陈
flutter·ai编程·dart