0
votes

Im new to Parse and I've tried playing around with Parse a little I've stumbled upon an error that I think shouldn't be there Whenever I declare a new user, and use the

signUpInBackground()

It returns a bad JSON response error saying that java.lang.String cannot be converted to a JSONObject even though according to the Parse docs, a string should convert to an object Would anyone help please? Thank you.! pic: Parse Bad JSON response error

2
Please add the logcat error. - Jamil
I don't know what parse.com is but the error means that your String is not in a format that can be converted to a JSONObject. Perhaps you're missing a comma, bracket etc. - u3l
Here is the error i.imgur.com/xHYZlel.jpg. I'm using and EditText for input and EditText.getString().toString() which should work since JSON supports Strings - Noah
Are you setting the user name and password in the user object you are creating before calling signUpInBackgroud()? Please show the rest of your code if you want help. - Oren
If you are running this on emulator please show the logcat error so that we can understand the error. - Jamil

2 Answers

0
votes

Make sure you are using the proper app id and client id. The code you posted looks correct.

https://www.parse.com/questions/bad-json-response-on-logincallback

0
votes

Had exactly this again today. Check for out of date library references!

Using Android Studio I was using compile 'com.parse:parse-android:1.+' which started giving me "Bad json response" issues when logging a user in. Changing the parse library to compile 'com.parse:parse-android:1.12 fixed this response for me.