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

Stack Overflow | Ghazal | 7 months ago
  1. 0

    android php org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject

    Stack Overflow | 7 months ago | Ghazal
    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
  2. 0

    获取用户信息报错

    GitHub | 2 years ago | ljsalm089
    org.json.JSONException: Value javax.net.ssl.SSLPeerUnverifiedException of type java.lang.String cannot be converted to JSONObject
  3. 0

    Error Report: Value <!doctype of type java.lang.String cannot be converted to JSONObject

    GitHub | 2 years ago | rastating
    org.json.JSONException: Value <!doctype of type java.lang.String cannot be converted to JSONObject
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Error Report: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

    GitHub | 2 years ago | rastating
    org.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject
  6. 0

    Error Report: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

    GitHub | 2 years ago | rastating
    org.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

  1. filpgame 13 times, last 1 week ago
  2. bluebunnty 1 times, last 4 weeks ago
  3. ajinkya_w 4 times, last 1 month ago
  4. pranavprakash 4 times, last 1 month ago
  5. Ranjana Dangol 2 times, last 5 months ago
12 more registered users
32 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. 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()
  2. Android Platform
    JSONObject.<init>
    1. org.json.JSON.typeMismatch(JSON.java:111)
    2. org.json.JSONObject.<init>(JSONObject.java:160)
    3. org.json.JSONObject.<init>(JSONObject.java:173)
    3 frames
  3. com.google.android
    Login$2$1.onResponse
    1. com.google.android.gms.fit.samples.basichistoryapi.Login$2$1.onResponse(Login.java:85)
    2. com.google.android.gms.fit.samples.basichistoryapi.Login$2$1.onResponse(Login.java:80)
    2 frames
  4. Android-Volley Library
    ExecutorDelivery$ResponseDeliveryRunnable.run
    1. com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:60)
    2. com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30)
    3. com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99)
    3 frames
  5. Android Platform
    ActivityThread.main
    1. android.os.Handler.handleCallback(Handler.java:739)
    2. android.os.Handler.dispatchMessage(Handler.java:95)
    3. android.os.Looper.loop(Looper.java:148)
    4. android.app.ActivityThread.main(ActivityThread.java:5417)
    4 frames
  6. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  7. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    2 frames