Platforms
Android
minSdk24,compileSdk37 (AAR metadata from Compose 1.12 and this library).- JNI libraries ship inside the AAR.
consumer-rules.proon the KMP AAR and the JNI AAR keeps JNI entry points; the app does not add extra keep rules. - Do not add a second copy of
libsweeteditor.so.
Desktop (JVM)
- JVM 11+.
- First load extracts Core + compose JNI from JAR resources into a per-user cache, then
System.load. - Keep rules ship in the JAR under
META-INF/proguard/andMETA-INF/com.android.tools/r8/. Compose Desktop's ProGuard task does not scan dependency JARs; include those files if you enable release minification.
iOS
- cinterop statically links
libsweeteditor.a(andlibsweetline.afor highlight) foriosArm64andiosSimulatorArm64. - The host Xcode project must not add
-lsweeteditor,-lsweetline, or-liconv. SweetLine embedsLC_LINKER_OPTION -liconv. - Device and simulator slices are different archives. A device object in the simulator klib fails with “built for iOS while targeting iOS-simulator”.
Web (JS and Wasm)
- The library injects
sweeteditor_web_abi.js/sweetline_web_abi.jsand loads*_c_abi.{js,wasm}from Compose resources (files/). - Host
index.htmldoes not need a manual script tag (0.1.1+). NativeBridge.isAvailablebecomes true after the C ABI module is ready.SweetEditorwaits up to ~1800 frames, then shows a load error.- Keep Compose 1.12.1 so Skiko exports
nGetUnresolvedCodepointsCount.
Shared constraints
All targets talk to the same C API. Line/column are 0-based. Colors are packed ARGB Int (0xAARRGGBB).