Skip to main content

Building Production Apps | Flutter Document Scanner

Building Production Apps

iOS

The Scanbot SDK iOS Framework (included in this Flutter Plugin) is provided as Pod via https://cocoapods.org.

Because Flutter apps are normal native apps at the end of the day, the way they are deployed to the App Store is just like any other native app.

Please, consult the official Apple documentation on Submitting Apps to the App Store for more information.

Android

The Scanbot Android SDK uses native libraries under the hood and supports the following ABIs: armeabi-v7a, arm64-v8a, x86 and x86_64.

To exclude certain ABIs from the APK, use the abiFilters property in the android/app/build.gradle file of your project:

android {
...
defaultConfig {
...
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
// Please add "x86" and "x86_64" if you would like to test on an emulator
// or if you need to support some rare devices with the Intel Atom architecture.
}
}
}

💡 However, if you need to support all architectures and would also like to optimize the APK size, we highly recommend checking out the Android App Bundle approach. It allows you to create and distribute dedicated, smaller APKs via the PlayStore.

ProGuard

Starting from v7.0.0, consumer ProGuard rules are integrated into the Scanbot SDK Flutter Package and automatically applied to customers' modules.

If you use an older version and have ProGuard/R8 enabled for the release/production build, please add the following rules:

For the Scanbot SDK Flutter Plugin

# Default Flutter rules
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn io.flutter.embedding.**
-ignorewarnings
-dontoptimize

-keepclassmembers enum io.scanbot.sdk.** { *; }

-keeppackagenames io.scanbot.sdk.persistence.**
-keep public class io.scanbot.sdk.persistence.**{ *; }

-keep public class io.scanbot.sdk.ui.** { *; }

-keep public class io.scanbot.sap.SapManager { *; }

-keeppackagenames io.scanbot.sdk.core.contourdetector.**
-keep public class io.scanbot.sdk.core.contourdetector.**{ *; }
-keeppackagenames io.scanbot.sdk.contourdetector.**
-keep public class io.scanbot.sdk.contourdetector.**{ *; }
-keeppackagenames com.googlecode.tesseract.android.**
-keep public class com.googlecode.tesseract.android.**{ *; }

-keeppackagenames io.scanbot.mrzscanner.**
-keep public class io.scanbot.mrzscanner.**{ *; }
-keeppackagenames io.scanbot.sdk.mcrecognizer.**
-keep public class io.scanbot.sdk.mcrecognizer.**{ *; }

-keeppackagenames io.scanbot.tiffwriter.**
-keep public class io.scanbot.tiffwriter.**{ *; }

-keeppackagenames io.scanbot.textorientation.**
-keep public class io.scanbot.textorientation.**{ *; }
-keeppackagenames io.scanbot.sdk.textorientation.**
-keep public class io.scanbot.sdk.textorientation.**{ *; }

-keeppackagenames io.scanbot.sdk.barcode.**
-keep public class io.scanbot.sdk.barcode.**{ *; }

-keeppackagenames io.scanbot.hicscanner.**
-keep public class io.scanbot.hicscanner.**{ *; }
-keeppackagenames io.scanbot.sdk.hicscanner.**
-keep public class io.scanbot.sdk.hicscanner.**{ *; }

-keeppackagenames io.scanbot.sdk.docprocessing.**
-keep public class io.scanbot.sdk.docprocessing.**{ *; }

-keeppackagenames io.scanbot.sdk.process.**
-keep public class io.scanbot.sdk.process.**{ *; }

-keeppackagenames io.scanbot.sdk.flutter.**
-keep public class io.scanbot.sdk.flutter.** { *; }
-keeppackagenames io.scanbot.sdk.ui.**
-keep public class io.scanbot.sdk.ui.**{ *; }

-keeppackagenames io.scanbot.sdk.vin.**
-keep public class io.scanbot.sdk.vin.**{ *; }
# Gson
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all this information.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
-keep class com.google.gson.stream.** { *; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}

For the native Scanbot SDK

Since Scanbot SDK version 1.74.0, consumer ProGuard/R8 rules are integrated into the library and automatically applied to customers' modules.

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license