Error: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter type
juanpicuervo opened this issue · 9 comments
Using the example provided in the Angular docs im not able to upload an image. It always give me the following error:
Error: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter type
"tns-android": {
"version": "6.3.0"
}
I haven't checked on 6.3.0. Will check.
Same here! Is it posible any workaround so far? Its quite crucial to upload pics in every app. Thanks a lot!
Yes indeed its an issue in 6.3.0. I dont have any wark around. Will need to chrck and try.
I tried to debug, as I can see the problem is in:
let builder = new okhttp3.MultipartBody.Builder() .setType(okhttp3.MultipartBody.FORM);
okhttp3.MultipartBody.FORM is null;
I tried to debug, as I can see the problem is in:
let builder = new okhttp3.MultipartBody.Builder() .setType(okhttp3.MultipartBody.FORM);
okhttp3.MultipartBody.FORM is null;
I think the problem is kotlin's companion objects.
Changing
okhttp3.MultipartBody.FORM
to
MediaType.parse("multipart/form-data")
should solve the problem, but unfortunatelly I don't have time try.
I tried to debug, as I can see the problem is in:
let builder = new okhttp3.MultipartBody.Builder() .setType(okhttp3.MultipartBody.FORM);
okhttp3.MultipartBody.FORM is null;I think the problem is kotlin's companion objects.
Changing
okhttp3.MultipartBody.FORM
to
MediaType.parse("multipart/form-data")
should solve the problem, but unfortunatelly I don't have time try.
Not it doesn't work. I have open the issue in NS repo.
@juanpicuervo @Imdapro it seems there is an issue in nativescript-imagepicker plugin. If you check parameters, data null that is why kotlin is complaining. Please check for null before you post.
Please check this issue.
Indeed there was still an issue. @Imdapro was right. I had to change it to following:
// builder.setType(okhttp3.MultipartBody.FORM);
const FORM_MEDIA_TYPE = okhttp3.MediaType.parse("multipart/form-data");
builder.setType(FORM_MEDIA_TYPE);