Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安卓打包安全图被自动压缩 #95

Open
jacky4631 opened this issue Nov 15, 2022 · 0 comments
Open

安卓打包安全图被自动压缩 #95

jacky4631 opened this issue Nov 15, 2022 · 0 comments

Comments

@jacky4631
Copy link

安卓发布时安全图被自动压缩,导致百川初始化失败,不知道大家有没有遇到这个问题。
我试过以下4个方法想保留安全图,但全部不起作用:

  1. 生成keep.xml放到res/raw目录

<?xml version="1.0" encoding="utf-8"?> <resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@drawable/yw_1222_baichuan"/>

  1. 修改build.gradle中release的混淆开关,然后打包
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled false//禁用混淆
            shrinkResources false
            zipAlignEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
  1. 启动命令加上--no-shrink

flutter build apk --no-shrink --no-sound-null-safety

  1. 升降gradle版本,目前使用的是

gradle-7.5.1-all.zip
com.android.tools.build:gradle:7.2.2

最后打包的资源仍然被混淆
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant