Prerequisites
- Flutter 3.22 or later
- Dart 3 or later
- iOS 15 or Android API 21 as the minimum application target
- A physical arm64 iOS or
arm64-v8aAndroid device - A Nosmai licence key for each native app identity
Add the Dart package
flutter pub add nosmai_effects_sdk:^1.0.2 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 .nosmai assets.
Add the Android native SDK
Download nosmai-sdk-3.0.4.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 21
ndk {
abiFilters 'arm64-v8a'
}
}
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 depends on NosmaiCameraSDK ~> 3.0.4. 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 AAR is about 51.4 MiB before App Bundle optimization. The verified iOS framework release ZIP is about 22.9 MiB compressed. 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 lacks arm64-v8a | Run on a physical ARM64 Android device |
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
- Control a camera game in Flutter