Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

Calling Kotlin methods from R: invokeMethod returns "java.lang.IllegalStateException: receiverKlass.java.classLoader must not be null" #1

Open
floidgilbert opened this issue Jan 26, 2018 · 0 comments
Assignees

Comments

@floidgilbert
Copy link
Owner

floidgilbert commented Jan 26, 2018

invokeMethod fails in Kotlin. This is a reported bug: KT-22414. There is a workaround: add the reference to the Kotlin bindings as in this example.

engine %@% "class A {fun f(): Int {return 8}}"
engine %@% "val a = A()"
engine %@% "a.f()"

# This line fails
engine$invokeMethod("a", "f")

# After adding the reference to bindings, the call works.
engine %@% "jsr223Bindings[\"a\"] = a"
engine$invokeMethod("a", "f")
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant