CapacitorHttp : JSValue could not be coerced to JSObject


I use for request, in web work fine but don’t in emulator android studio

the error is:

E/Capacitor/Plugin: JSONException
    org.json.JSONException: JSValue could not be coerced to JSObject.
        at com.getcapacitor.JSValue.toJSObject(
        at com.getcapacitor.plugin.util.CapacitorHttpUrlConnection.setRequestBody(
        at com.getcapacitor.plugin.util.HttpRequestHandler.request(
        at com.getcapacitor.plugin.CapacitorHttp$

this is my code

const options = {
            url: scriptName,
            headers: { 
                'X-Requested-With': 'XMLHttpRequest',
                "Content-Type": (!isFile ? "application/x-www-form-urlencoded": "multipart/form-data"),
                "Accept": "application/json" 
            data: (!isFile ?  args.join("&"): args),

        const response: HttpResponse = await;

        if (response.status !== 200) {
            console.log("Respuesta invalida");
            if (!inBackground){ await hideLoading(); }
            await errorMsg("El servidor no response");
            throw "Error de conexion"

        if ({
            if (!inBackground){ await hideLoading(); }
            await errorMsg(;


Finally, i decide used axios, this work without problem