AOSP Kotlin support

Viewed 1565

I am building an AOSP android app using Android.mk, and it has a depdendency that needs kotlin-stdlib to work, so I have added it to the lisst of LOCAL_PREBUILT_JAVA:STATIC_LIBRARIES:

AOSP 8.1 (Api lvl 27)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := 
    jetbrains-kotlin-sdk:libs/kotlin-stdlib-jdk7-1.3.61.jar \
    jetbrains-kotlin-sdk-sources:libs/kotlin-stdlib-jdk7-1.3.61-sources.jar \
    jetbrains-kotlin-sdk-javadoc:libs/kotlin-stdlib-jdk7-1.3.61-javadoc.jar

It builds fine, but when I run the app I got a runtime error:

 java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;

¿How can I add kotlin-stdlib to my app to solve this error?

1 Answers

Unfortunately, Kotlin is not supported on Android.mk and AOSP build system, it is a log discussion on supporting Kotlin for system application and framework codes. even the Android.bp and new build system does not support Kotlin.

Here is the link of discussion: https://groups.google.com/g/android-platform/c/2TykGjNzYMc

Related