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

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

相关推荐
大筒木老辈子11 小时前
Linux笔记---协议定制与序列化/反序列化
网络·笔记
草莓熊Lotso12 小时前
【C++】递归与迭代:两种编程范式的对比与实践
c语言·开发语言·c++·经验分享·笔记·其他
我爱挣钱我也要早睡!14 小时前
Java 复习笔记
java·开发语言·笔记
汇能感知19 小时前
摄像头模块在运动相机中的特殊应用
经验分享·笔记·科技
阿巴Jun19 小时前
【数学】线性代数知识点总结
笔记·线性代数·矩阵
茯苓gao20 小时前
STM32G4 速度环开环,电流环闭环 IF模式建模
笔记·stm32·单片机·嵌入式硬件·学习
是誰萆微了承諾20 小时前
【golang学习笔记 gin 】1.2 redis 的使用
笔记·学习·golang
DKPT21 小时前
Java内存区域与内存溢出
java·开发语言·jvm·笔记·学习
ST.J21 小时前
前端笔记2025
前端·javascript·css·vue.js·笔记
Suckerbin21 小时前
LAMPSecurity: CTF5靶场渗透
笔记·安全·web安全·网络安全