Skip to main content

Adding the Flutter Embrace SDK

Add the Dart Library

Add the Embrace package to pubspec.yaml with the following command:

flutter pub add embrace

iOS Setup

Add the Embrace App ID

Create the Embrace-Info.plist configuration file. You can find your 5-character app ID and API token in the Embrace dashboard:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>{YOUR_APP_ID}</string>
<key>API_TOKEN</key>
<string>{YOUR_API_TOKEN}</string>
<key>CRASH_REPORT_ENABLED</key>
<true/>
</dict>
</plist>

Uploading Symbol Files

To make stack traces of native crashes readable, Embrace needs the dSym symbol files of your application. These can be uploaded with a script included in the Embrace iOS SDK.

On the Xcode Build Phase tab, add a new run script. You can find your 5-character app ID and API token in the Embrace dashboard:

EMBRACE_ID={YOUR_APP_ID} EMBRACE_TOKEN={YOUR_API_TOKEN} "${PODS_ROOT}/EmbraceIO/run.sh"

Android Setup

In the root-level build.gradle file, add the embrace-swazzler dependency:

  buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'io.embrace:embrace-swazzler:5.15.2'
}
}

In the app/build.gradle file, add:

apply plugin: 'com.android.application'
apply plugin: 'embrace-swazzler'

In app/src/main, add a config file named embrace-config.json. You can find your 5-character app ID and API token in the Embrace dashboard:

{
"app_id": "{YOUR_APP_ID}",
"api_token": "{YOUR_APP_TOKEN}",
"ndk_enabled": true
}

Next, you'll be creating your first session.