@PluginManifest, and bundle it into a .klyx file.
Prerequisites
- Android Studio (latest stable)
- A Klyx-compatible device or emulator running Klyx 4.2.0 or later
- Basic knowledge of Kotlin and Jetpack Compose
- Kotlin 2.1 or later (for context receivers support)
1. Create the project
Create a new Android project in Android Studio with No Activity. Use minimum SDK 28 and Kotlin. Your project structure should look like this:plugin.json file — the @PluginManifest annotation generates it for you at compile time.
2. Configure the version catalog
Ingradle/libs.versions.toml:
3. Set up the root build file
Inbuild.gradle.kts:
4. Configure the app module
Inapp/build.gradle.kts:
5. Write the Android manifest
Inapp/src/main/AndroidManifest.xml:
@PluginManifest annotation, not the manifest.
6. Implement the plugin
Inapp/src/main/java/com/yourext/MyExtension.kt:
screens.register(...) does not require passing this. Registration methods use Kotlin context receivers — the compiler infers the plugin from the surrounding KlyxPlugin context.
7. Build the bundle
Run the Gradle task:output/MyExtension.klyx — a gzipped tarball containing your APK and the generated plugin.json.
8. Install on Klyx
Transfer the.klyx file to your device and open it with Klyx. Klyx extracts the bundle, reads plugin.json, loads the APK, instantiates your entryClass, and calls onLoad() followed by onStart().
Next steps
Plugin Manifest Reference
Full reference for the @PluginManifest annotation
Plugin Lifecycle
Understand load, start, stop, and unload
Building & Bundling
Package and publish your extension