Flutter SmartFace Plugin Installation Guide

This guide outlines the necessary steps to get the SmartFace Flutter plugin up and running on your Android and iOS devices.

Table of Contents

Android Setup

Download Native Libraries

  1. Download the native libraries from this Google Drive link.

Copy the .aar to example/android/libs

  1. After downloading the package, move only the .aar file to example/android/libs/ in your Flutter project.

    mkdir -p path/to/flutter_project/example/android/libs
    cp path/to/downloaded/smartfacemobile-v8.2.0-m7_202603311819.aar path/to/flutter_project/example/android/libs/
    

    The example/android/libs directory must contain exactly one .aar file. The filename can keep its original versioned/timestamped name. Do not rename it. You do not need to extract additional files or rename the library before building.

Modify android/app/build.gradle

  1. Open your android/build.gradle file and add the following lines inside it:

    project(':flutter_smartface') {
        ext.libsDir = rootProject.file('libs')
    }
    

    Make sure to sync your project after adding this line. The plugin will automatically detect and consume the only .aar file found in example/android/libs during build. If the folder is empty or contains more than one .aar, the build will fail with a clear error.

Configure ProGuard Rules

  1. If you're using ProGuard for your release builds, add the following rules to your android/app/proguard-rules.pro file:

    -keepclassmembers class br.com.visica.sface.** {
      *;
    }
    

    This ensures that the SmartFace SDK classes are not obfuscated during the build process.

iOS Setup

Quick Start

  1. Create the frameworks folder:

    mkdir -p ios/SmartfaceSDK
    
  2. Copy the three required .xcframework bundles to ios/SmartfaceSDK/:

    • SmartfaceMobile.xcframework
    • SmartfaceMobileUIKit.xcframework
    • sface.xcframework
  3. Open ios/Runner.xcworkspace in Xcode

  4. Add the frameworks to Runner target:

    • Go to Runner target → General → Frameworks, Libraries, and Embedded Content
    • Click "+", add the three frameworks from ios/SmartfaceSDK/
    • Set each to "Embed & Sign"
  5. Run pod install:

    cd ios && pod install && cd ..
    

Detailed Instructions

For complete iOS setup instructions, troubleshooting, and technical details, see:

Requirements

  • iOS 12.0 or higher
  • Xcode 12+
  • CocoaPods

Get Credentials

  1. To complete the setup, you'll need specific credentials for the SmartFace service. Please contact the support team to obtain these credentials.

Congratulations, you've successfully set up the SmartFace Flutter plugin for Android! If you encounter any issues, please refer to the troubleshooting section or contact support.