org.json.JSONException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject Here is my php code: <?php $con = mysqli_connect("DBHOST", "USERNAME", "PASSWORD!", "DBNAME"); $username = $_POST["username"]; $password = $_POST["password"]; $statement = mysqli_prepare($con, "INSERT INTO user (username, password) VALUES (?, ?)"); mysqli_stmt_bind_param($statement, "ss", $username, $password); mysqli_stmt_execute($statement); $response = array(); $response["success"] = true; print_r(json_encode($response)); ?> and here is my logcat: 04-30 15:55:06.585 11289-11289/? I/art: Not late-enabling -Xcheck:jni (already on) 04-30 15:55:06.708 11289-11289/com.google.android.gms.fit.samples.basichistoryapi W/System: ClassLoader referenced unknown path: /data/app/com.google.android.gms.fit.samples.basichistoryapi-1/lib/x86 04-30 15:55:06.956 11289-11319/com.google.android.gms.fit.samples.basichistoryapi D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 04-30 15:55:07.062 11289-11319/com.google.android.gms.fit.samples.basichistoryapi I/OpenGLRenderer: Initialized EGL, version 1.4 04-30 15:55:07.094 11289-11319/com.google.android.gms.fit.samples.basichistoryapi W/EGL_emulation: eglSurfaceAttrib not implemented 04-30 15:55:07.094 11289-11319/com.google.android.gms.fit.samples.basichistoryapi W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xad7e0740, error=EGL_SUCCESS 04-30 15:55:19.158 11289-11289/com.google.android.gms.fit.samples.basichistoryapi W/System.err: org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject at org.json.JSON.typeMismatch(JSON.java:111) at org.json.JSONObject.<init>(JSONObject.java:160) at org.json.JSONObject.<init>(JSONObject.java:173) at com.google.android.gms.fit.samples.basichistoryapi.Login$2$1.onResponse(Login.java:85) at com.google.android.gms.fit.samples.basichistoryapi.Login$2$1.onResponse(Login.java:80) at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:60) at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30) at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Users with the same issue

Hiren Amaliyar
2 times, last one,
Unknown User
38 times, last one,
Indri Yunita
4 times, last one,
filpgame
32 times, last one,
gamebusterz
4 times, last one,
78 more bugmates