Skip to main content

Building production apps with the Flutter Barcode Scanner SDK

iOS

The Scanbot SDK iOS Framework (included in the Flutter SDK) is provided as a 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 Flutter SDK uses native libraries under the hood and supports the following ABIs: armeabi-v7a, arm64-v8a, x86, and x86_64.

If you use an App Bundle, which is the preferred way to distribute your app, you don’t need API filters. It allows you to create and distribute dedicated and smaller APKs via the PlayStore.

If you use an APK, you can reduce its size by filtering out unused architectures. To exclude specific ABIs, use the abiFilters property in your project's Android Gradle settings.

Please check and adjust the abiFilters configuration in your project's android/app/build.gradle file:

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.
}
}
}

Proguard

Starting from v7.0.0, consumer ProGuard rules are integrated into the Scanbot Flutter SDK 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:

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

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

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

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

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

-keepclassmembers enum io.scanbot.** {*;}
-keepclassmembers class io.scanbot.** extends java.lang.Enum {
<fields>;
public static **[] values();
public static ** valueOf(java.lang.String);
}

# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**
-dontwarn org.jetbrains.annotations.**

-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-keep public class kotlin.reflect.jvm.internal.impl.** { public *; }
-keepclassmembers class kotlin.Metadata {
public <methods>;
}

##---------------Begin: proguard configuration for 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 of it.
-keepattributes Signature

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

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

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends 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>;
}
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken

##---------------End: proguard configuration for Gson ----------

Want to scan longer than one minute?

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

Get free trial license

On this page