Usar kotlin con ContentResolver causa IllegalArgumentException

Intento escribir una aplicación con Kotlin. Puse al proveedor de contenido consultando sql en el otro process. Al consultar por ContentResolver en el process principal, la aplicación se bloqueó.

El código es:

protected fun select(uri: Uri, sql: String, vararg args: Any): Cursor { val sArgs = Array(args.size(), { i -> lang.String.valueOf(args.get(i)) }) return context.getContentResolver().query(uri, null, sql, sArgs, null) } public fun selectAllAccounts(): Array<Account> { val cursor = select(parseUri(AccountSchema.TABLE_NAME), "select * from " + AccountSchema.TABLE_NAME) val accounts = Array(cursor.getCount(), { i -> if (!cursor.moveToPosition(i)) { throw RuntimeException("Cursor move failed") } Account(context, cursor) }) return accounts } 

Lanzará una exception IllegalArgumentException:

 05-20 10:27:21.120 3337-3337/com.kescoode.yomail E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.kescoode.yomail, PID: 3337 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kescoode.yomail/com.kescoode.yomail.ui.activity.HomeActivity}: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter projection at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2212) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2271) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5146) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter projection at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137) at android.content.ContentProviderProxy.query(ContentProviderNative.java:420) at android.content.ContentResolver.query(ContentResolver.java:461) at android.content.ContentResolver.query(ContentResolver.java:404) at com.kescoode.yomail.db.Dao.select(internal.kt:33) at com.kescoode.yomail.db.AccountDao.selectAllAccounts(AccountDao.kt:21) at com.kescoode.yomail.App.isLogged(App.kt:28) at com.kescoode.yomail.ui.activity.HomeActivity.onCreate(HomeActivity.kt:17) at android.app.Activity.performCreate(Activity.java:5231) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169