Sammy_1 0 Newbie Poster

I am taking a class on RN with Kotlin and got stuck on this assignment. When I try to pass an array of integers from JS to Kotlin, I get the error java.lang.RuntimeException: Got unknown argument class: int[].

Calculator.kt

@ReactMethod
fun getSum(values: IntArray, callback: Callback){
  var total = 0;
  // get total
  callback.invoke( null, total)
}

From JS i call it like this:

 KTFile.getSum([1,2,3],(err,ok)=>{

   });

but it crushes immediately with the error:

java.lang.RuntimeException: Got unknown argument class: int[] when passing a JS array to a java