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

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

相关推荐
Bigger19 小时前
Flutter 开发实战:解决华为 HarmonyOS 任务列表不显示 App 名称的终极指南
android·flutter·华为
小智RE0-走在路上1 天前
Python学习笔记(8) --函数的多返回值,不同传参,匿名函数
笔记·python·学习
摇滚侠1 天前
Redis 零基础到进阶,Redis 哨兵监控,笔记63-73
数据库·redis·笔记
老王熬夜敲代码1 天前
网络中数据传输的具体过程
linux·网络·笔记
charlie1145141911 天前
现代C++嵌入式教程:C++98基础特性:从C到C++的演进(1)
c语言·开发语言·c++·笔记·学习·教程
梧桐ty1 天前
鸿蒙应用冷启动优化:Flutter首屏秒开与白屏治理实战
flutter·华为·harmonyos
汤愈韬1 天前
TK_网络基础和常见攻击(笔记)
网络·笔记
梧桐ty1 天前
驾驭未来:基于鸿蒙的Flutter车载应用与手机端协同实战
flutter·华为·harmonyos
nnsix1 天前
QFramework学习笔记
笔记·学习
XFF不秃头1 天前
力扣刷题笔记-全排列
c++·笔记·算法·leetcode