Prerequisites
- Flutter 3.22 or later
- Dart 3 or later
- iOS 15 or Android API 24 as the minimum application target
- A physical arm64 iOS device, or an Android device that supports
arm64-v8aorarmeabi-v7a - A Nosmai licence key for each native app identity
Requirement details
The Dart package provides the Flutter-facing commands and preview widget. The native dependencies are the underlying Android and iOS libraries that perform the platform camera work. Both layers are required. The iOS framework targets physical arm64 devices. Android SDK 3.0.5 includes both arm64-v8a (64-bit ARM) and armeabi-v7a (32-bit ARM); x86 and x86_64 emulators are not supported.
Add the Dart package
flutter pub add nosmai_effects_sdk:^1.0.3 flutter pub add permission_handler
The public Dart package contains the Flutter API and native bridges. It does not contain proprietary native SDK binaries or licensed effect packages.
Add the Android native SDK
Download nosmai-sdk-3.0.5.aar and SHA256SUMS from the official Android release. Verify the checksum, then copy the AAR to this exact path and name:
android/app/libs/nosmai-release.aar
Add the app-owned runtime dependency in android/app/build.gradle:
android {
compileSdkVersion 35
defaultConfig {
minSdkVersion 24
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
dependencies {
implementation files('libs/nosmai-release.aar')
}
The Flutter plugin uses compileOnly for this dependency so the native binary is not duplicated in the pub.dev archive. Keep exactly one app-level AAR.
Add permissions to android/app/src/main/AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:label="camera_app"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher" />
</manifest>
Configure iOS
Set the minimum deployment target in ios/Podfile:
platform :ios, '15.0'
The Flutter pod declares NosmaiCameraSDK ~> 3.0.4, a compatible version range that resolves the current 3.0.5 pod. Do not add a manual framework copy when using CocoaPods.
Add permission descriptions to ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key> <string>This app uses the camera for real-time filters and effects.</string> <key>NSMicrophoneUsageDescription</key> <string>This app uses the microphone when recording video.</string> <key>NSPhotoLibraryAddUsageDescription</key> <string>This app saves captured photos and videos to your library.</string>
Install pods:
cd ios pod install --repo-update cd ..
The iOS framework has no simulator slice. Run the camera integration on a physical arm64 iPhone or iPad.
Native size impact
The Android 3.0.5 AAR is 59,140,732 bytes (56.4 MiB) before App Bundle optimization and contains both supported ARM ABIs. The iOS 3.0.5 framework bundle is 34,207,000 bytes (32.6 MiB), and its verified release ZIP is 22,661,254 bytes (21.6 MiB). The Dart wrapper is small relative to the native binaries. Measure signed release builds because store compression, app thinning, selected assets, and existing dependencies change the final download increase.
Verify it worked
Run static analysis:
flutter analyze
Then build for one physical target:
flutter build apk --debug
or:
flutter build ios --no-codesign
A successful native build confirms package linking. Continue to the Flutter quickstart to request permission, initialize Nosmai, and render a visible effect.
Common errors
| Error | Cause | Fix |
|---|---|---|
Could not find :nosmai-release: | Android AAR is missing or named differently | Put the verified artifact at android/app/libs/nosmai-release.aar |
Duplicate class com.nosmai | More than one native AAR is linked | Remove duplicate copies and keep the app-level runtime dependency only |
INSTALL_FAILED_NO_MATCHING_ABIS | Android device or build includes neither arm64-v8a nor armeabi-v7a | Run on a supported physical ARM Android device and retain at least one supported ABI |
building for iOS Simulator, but linking in object file built for iOS | Flutter selected an iOS Simulator | Select a physical iOS device |
CocoaPods not installed or not in valid state | iOS native dependencies were not resolved | Install CocoaPods, run pod install --repo-update, and retry |
Next steps
- Add real-time camera effects to a Flutter app
- Get and apply a licence key
- Check Flutter capability support
- Apply a beauty filter in Flutter