This repository explains how to package a Unity scene as a platform-specific library and embed it inside a native host app.
Currently, the implementation focuses on Android (Kotlin), with iOS support coming soon.
On Android, Unity is exported as an Android library (AAR) and embedded into a Kotlin-based app.
Use this setup if you want a native Android shell that launches Unity for navigation or other 3D experiences while keeping control in Kotlin.
Android/Unity_AAR_Integration_Kotlin.md– exhaustive Unity export and Android integration guide.AndroidSample/– minimal Kotlin app showing how to launch Unity, pass MapCode data, and handle results.unityLibrary-debug.aar(generated) – Unity output that gets dropped into the Android sample’sapp/libs/folder.
- Unity 6.0 (6000.0.62f1) LTS or newer with Android Build Support.
- Android Studio Flamingo or newer with SDK + NDK installed.
- Java 11+ and Gradle 8+ (the Android sample uses Kotlin DSL scripts).
- Export from Unity – Enable Export Project, export to
UnityExport/, then build the AAR via Gradle (unityLibrary:assembleDebug). - Update Android Sample – Copy the generated
unityLibrary-debug.aarintoAndroidSample/app/libs/. - Sync & Run – Open
AndroidSample/in Android Studio, sync Gradle, and run on a device. Use the MapCode field to send data into Unity; observe return data in theresultTextView. - Manifest Cleanup – In
UnityExport/unityLibrary/src/main/AndroidManifest.xml, comment or remove the launcher<intent-filter>fromUnityPlayerGameActivityto avoid duplicate app icons.
The full Android walkthrough with screenshots, Gradle snippets, manifest requirements, and Android↔Unity messaging examples lives in
Android/Unity_AAR_Integration_Kotlin.md. Check that file first when in doubt.
iOS support will allow embedding the same Unity experience inside a native iOS app, following a similar pattern to Android:
- Unity exported as an iOS framework/library.
- Native iOS host responsible for app shell, navigation, and lifecycle.
- Structured data exchange between iOS and Unity.
- Planned: Design and implementation in progress.
- Not yet available: No iOS sample project is included in this repository.