Building Production Apps | React Native Document Scanner
Building Production Apps
iOS
The native Scanbot SDK iOS Framework (ScanbotSDK.framework
) is installed as a CocoaPods dependency ScanbotSDK
.
It contains the architectures arm64
and x86_64
. You can thus run it on most iOS devices as well as
on simulators during the development phase.
To be able to submit a production build to App Store Connect (App Store / TestFlight) the architecture x86_64
must be removed (striped out) from the Scanbot SDK Framework. This architecture is only for simulators and is not allowed
to be submitted to App Store Connect. In a CocoaPods powered project this is typically done by CocoaPods,
so no manual action is required here.
However, if you get this error while uploading your app, the following manual configuration steps must be done to fix it:
ERROR ITMS-90087: "Unsupported Architectures. The executable for [...].app/Frameworks/ScanbotSDK.framework contains unsupported architectures '[x86_64]'."
We provide a script strip-SBSDK-Framework.sh
as a part of the ScanbotSDK.framework
and it can be easily integrated
in the build process. This script removes the unnecessary architectures from the frameworks binary,
code signs the framework and adds the crash symbols (dSYM) file to your app's archive.
To add this script in your build process, you will need to open the Xcode workspace .xcworkspace
and apply a few changes there:
- Go to
TARGETS
settings and open the tabBuild Phases
. Add a newRun Script Phase
via "+" button. - Adjust this
Run Script Phase
with the following script data:
Script code:
bash "${PODS_ROOT}/ScanbotSDK/ScanbotSDK.framework/strip-SBSDK-Framework.sh"
Script Input File:
${PODS_ROOT}/ScanbotSDK/ScanbotSDK.framework.dSYM
Android
The Scanbot SDK uses native libraries under the hood and supports the following ABIs:
armeabi-v7a
, arm64-v8a
, x86
and x86_64
.
By default the native libraries of all these architectures will be included in the app package (APK),
which will result in a big APK file. Please consider removing support for x86
and x86_64
architectures.
In most cases both “x86” architectures can be removed for the release (production) build, since they are only used on
emulators and on some rare devices with the Intel Atom architecture.
To exclude certain ABIs from the APK, use the abiFilters
property in the Android Gradle settings of your project.
Please check and adjust the abiFilters
configuration in your build.gradle
file accordingly:
android {
...
defaultConfig {
...
ndk {
// a typical production configuration:
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
}
💡 However, if you need to support all architectures and to optimize the APK size, we highly recommend checking out the Android App Bundle approach. It allows you to create and distribute dedicated and smaller APKs via the PlayStore (basically it is similar to the iOS App Store approach).
Want to scan longer than one minute?
Generate your free "no-strings-attached" Trial License and properly test the Scanbot SDK.
Get your free Trial LicenseWhat do you think of this documentation?
What can we do to improve it? Please be as detailed as you like.