Skip to main content
GuidesAPI ReferenceExamplesFAQ

Integrate the SDK

|

Add the package to your project

The Magiclane Maps SDK for Flutter is available as a pub.dev package. In your pubspec.yaml file add magiclane_maps_flutter package to your dependencies:

dependencies:
flutter:
sdk: flutter
magiclane_maps_flutter:

Run flutter pub get to install the new dependency.

Native configuration

First, verify that the ANDROID_SDK_ROOT environment variable is set to the root path of your Android SDK.

In android/build.gradle.kts add the maven block as shown, within the allprojects block, for both debug and release builds:

allprojects {
repositories {
google()
mavenCentral()
maven {
url = uri("https://developer.magiclane.com/packages/android")
}
}
}

Additionally, for release builds, in android/app/build.gradle.kts, within the android block, add the following lines to disable code shrinking and resource shrinking:

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug")
isMinifyEnabled = false
isShrinkResources = false
}
}
Common issues and troubleshooting

Reinstall dependencies

Make sure the flutter doctor command does not report any issues. Run flutter clean and flutter pub get to ensure all dependencies are correctly installed.

Android configuration issues

If issues persist on Android, try opening the android folder in Android Studio and syncing the Gradle files.

Other issues

If you still encounter issues, try cleaning the cache for flutter packages by running:

flutter pub cache clean

App craches on iOS startup in release mode

Make sure you have the following entry in your iOS project's info.plist file (by default, a Flutter project contains this entry, but if you have removed it please re-add it as it's required by SDK initialization).

This setting is required for proper localization and application stability in release mode. The app will crash at startup otherwise.

<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>