Skolson5903
12/23/2025, 8:01 PMcom.android.kotlin.multiplatform.library plugin. It deprecates the old android block from com.android.library, which had the externalNativeBuild/cmake and defaultConfig/externalNativeBuild/cmake clauses that now need to be converted. The doc page for the new plugin doesn't go into detail for how to do this. Does anyone know of detailed doc or an example project that shows what the new plugin needs for specifying stuff like the NDK version, cmake version, cmake environment vars definition, etc? Or is some other approach intended, like no more JNI, just cinterop, or what? The text below from the KMP library plugin page is too vague for me - I'm unsure what it is telling me to do.
Native build support
The new plugin focuses on producing a standard AAR for the Android target. Native code integration in Kotlin Multiplatform is handled directly by KMP's own native targets (such as androidNativeArm64 and androidNativeX86) and its C-interop capabilities. If you need to include native C/C++ code, you should define it as part of a common or native source set and configure the C-interop within the kotlin block, rather than using the Android-specific externalNativeBuild mechanism.
Alternatively, if you need native build support, then our recommendation is to create a separate standalone com.android.library where you can integrate the native code and consume the standalone library from your Kotlin Multiplatform library project.
This kind of sounds like I need to cinterop to the JNI wrapper code (C++) I have, but am unsure if that's correct. Thanks in advance for any info.jw
12/23/2025, 11:12 PMjw
12/23/2025, 11:14 PMSkolson5903
12/24/2025, 8:05 PMjw
12/24/2025, 8:08 PMjw
12/24/2025, 8:08 PMSkolson5903
12/24/2025, 8:09 PM