Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

492
Views
¿Por qué activar StackOverflowError con Big JsonObject?

Estoy tratando de enviar valores de cadena grandes (foto(s) formateada(s) en base64) con la biblioteca de red de Android (OkHttp).

 JSONObject jsonObj= new JSONObject(); JSONArray photosBase64JsonArray = new JSONArray(); for (String photoBase64:myPhotosBase64 ) { photosBase64JsonArray.put(photoBase64); } jsonObj.put("photos", photosBase64JsonArray); AndroidNetworking.post(serverAddress) .addJSONObjectBody(jsonObj) .setPriority(Priority.IMMEDIATE) .addHeaders("myHeader", "testing") .build() .getAsJSONObject()....

Estoy recibiendo esta excepción:

 java.lang.StackOverflowError: stack size 8192KB at java.lang.StringBuilder.append(StringBuilder.java:203) at org.json.JSONStringer.string(JSONStringer.java:354) at org.json.JSONStringer.value(JSONStringer.java:261) at org.json.JSONObject.writeTo(JSONObject.java:733) at org.json.JSONObject.toString(JSONObject.java:701) at com.androidnetworking.common.ANRequest$PostRequestBuilder.addJSONObjectBody(ANRequest.java:1394)

¿Cómo puedo enviar valores de cadena muy largos?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Usé Fast Android Networking con Jackson Parser y el problema se resolvió :)

 implementation 'com.amitshekhar.android:jackson-android-networking:1.0.2' AndroidNetworking.setParserFactory(new JacksonParserFactory());
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!