rules_kotlin icon indicating copy to clipboard operation
rules_kotlin copied to clipboard

`kt_android_library` cannot depend on a cc_library

Open emctague opened this issue 3 years ago • 2 comments

kt_android_library seems unable to link to NDK / JNI binaries:

in deps attribute of kt_jvm_library rule //project:project-android_kt: '//project:jni_lib' does not have mandatory providers: 'JavaInfo'. Since this rule was created by the macro 'kt_android_library', the error might have been caused by the macro implementation

Source:


cc_library(
    name = "jni_lib",
    srcs = glob([
        "cpp/*.cpp",
        "cpp/*.h",
    ])
)

kt_android_library(
    name = "project-android",
    srcs = glob([
        "java/**/*.java",
        "java/**/*.kt",
    ]),
    custom_package = "com.example.project",
    manifest = "AndroidManifest.xml",
    resource_files = glob(["res/**/*"]),
    deps = [":jni_lib"],
)

emctague avatar May 26 '22 18:05 emctague

Temporary workaround is to wrap :jni_lib in a java_library

restingbull avatar May 27 '22 19:05 restingbull