registration with VOLLEY and KOTLIN issue , can somebody say me what is issue I'm getting followed error :

registration with VOLLEY and KOTLIN issue , can somebody say me what is issue I'm getting followed error :

我遇到以下代码的错误 有人可以帮帮我吗 我正在尝试通过此代码注册到应用程序

注册 VOLLEY 和 KOTLIN 问题,有人能告诉我我遇到的问题是什么吗?错误:

我正在添加这个以获取更多详细信息 post 我的问题

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)


 `override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        loading = findViewById<ProgressBar>(R.id.loading)
        name = findViewById<EditText>(R.id.name)
        email = findViewById<EditText>(R.id.email)
        password = findViewById<EditText>(R.id.password)
        c_password = findViewById<EditText>(R.id.password)
        btn_regist = findViewById<Button>(R.id.btn_regist)

        btn_regist.setOnClickListener() { v -> regist() }
    }

    private fun regist(){
        loading.visibility = View.VISIBLE
        btn_regist.visibility = View.GONE

        val name:String = this.name.text.trim().toString()
        val email:String = this.email.text.trim().toString()
        val password:String = this.password.text.trim().toString()

        val stringRequest = object : StringRequest(com.android.volley.Request.Method.POST, URL_REGIST,
            com.android.volley.Response.Listener<String>() { response ->
                try {
                    val jsonObject = JSONObject(response)
                    val success : String = jsonObject.getString("success")
                    if (success.equals("1")){
                        Toast.makeText(this, "Register Success ! Eyyvalll !", Toast.LENGTH_SHORT).show()
                    }
                }
                catch (e: JSONException){
                    e.printStackTrace()
                    Toast.makeText(this, "Register Error ! goh !!!! :/" + e.toString() , Toast.LENGTH_SHORT).show()
                    loading.visibility = View.GONE
                    btn_regist.visibility = View.VISIBLE

                }
            }, com.android.volley.Response.ErrorListener {
                    error -> error.printStackTrace()
                    Toast.makeText(this, "Register Error ! SHIT :/" + error.toString() , Toast.LENGTH_SHORT).show()
                    loading.visibility = View.GONE
                    btn_regist.visibility = View.VISIBLE
            }) {
//            @Throws(AuthFailureError::class)
            override fun getParams(): Map<String, String> {
                val params = HashMap<String, String>()
                params["name"] = name
                params["email"] = email
                params["password"] = password
                return params
            }
        }

        val requestQueue = Volley.newRequestQueue(this)
        requestQueue.add(stringRequest)

    }`

我想到这个错误是因为响应结果不是有效的 json 格式

com.android.volley.Response.Listener<String>() { response ->
    try {
            //at this point,you can debug result with console log your response
            //because if response have a php error then json format not valid 
            Log.d("RESPONSE"," $response")
            val jsonObject = JSONObject(response)
            //at this you can check if json has have key name success
            if (jsonObject.has("success")){
                val success : String = jsonObject.getString("success")
                if (success.equals("1")){
                    Toast.makeText(this, "Register Success ! Eyyvalll !", Toast.LENGTH_SHORT).show()
                }
            }
    }
    ......

希望对您有所帮助