Home > Software engineering >  cannot build an apk while setting useProguard true Flutter
cannot build an apk while setting useProguard true Flutter

Time:12-29

i need to set useProguard true as iam using this Package
https://pub.dev/packages/jitsi_meet

but when i use this command (flutter build apk --split-per-abi) to build an APK i get this errorr

No signature of method: build_4yynebg217r84s3g2thgvw6p3.android() is applicable for argument types: (build_4yynebg217r84s3g2thgvw6p3$_run_closure2) values: [build_4yynebg217r84s3g2thgvw6p3$_run_closure2@5c06ab28]

when i remove useProguard true i manage to build an APK but my app crash whenever i try to use this package

and i am on

dependencies {
        classpath 'com.android.tools.build:gradle:7.1.2'

CodePudding user response:

Removing "useProguard" from build.gradle fixed the problem for me, like:

release { minifyEnabled true //useProguard true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }

Update 2022, or Details; R8 is nowadays:

By default enabled, And it simply replaces ProGuard, But supports existing .pro files (and there should be no need to reconfigure).

Also, any way to disable R8, or use ProGuard instead, is deprecated (or even removed). But debug flavors can set debuggable true, and continue to be debuggable line-by-line.

  • Related