Parse-server: com.parse.ParseRequest$ParseRequestException: bad json response

Created on 3 Mar 2016  路  10Comments  路  Source: parse-community/parse-server

Here is someone else reported this earlier

It looks like I am facing the same issue as above with the newer version of
Parse API 'com.parse:parse-android:1.13.0'

Downgrading to Parse API 'com.parse:parse-android:1.12.0' doesn't work for me either. I get error in
.server("http://10.0.2.2:1337/parse") in below code. saying can not resolve method server(java.lang.string)

Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
                    .applicationId("NjTVO3LsUaJ9QW8MEUDUSs3aYhqmAWq1ErCy9fBp")
                    .clientKey(null)
                    .server("http://10.0.2.2:1337/parse")
                    .build()
    );

Here is my gradle file :

buildscript {
repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}

}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.buddyreminder.app"
    minSdkVersion 16
    targetSdkVersion 23
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
    debug {
        debuggable true
    }
}
}

dependencies {
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
//compile files('libs/Parse-1.13.0.jar')
compile 'com.parse:parse-android:1.13.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile files('libs/simmetrics_jar_v1_6_2_d07_02_07.jar')
compile('com.digits.sdk.android:digits:1.9.3@aar') {
    transitive = true;
}

}

Most helpful comment

I got same issue and I fixed it by adding "/" to the end of server.
"http://10.0.2.2:1337/parse" -> "http://10.0.2.2:1337/parse/"
Hope it will help you

All 10 comments

Is this an issue related to Parse Server? Is your app making any requests to Parse Server that are failing? Use Parse Network Interceptors to find out. If your app isn't making any requests, then try the Android SDK repo.

yes its an issue related to parse server.

I am making this request :

ParseCloud.callFunctionInBackground("SaveNewData", newDataObj, new FunctionCallback<String>() {
        @Override
        public void done(String result, com.parse.ParseException e) {
            if (e == null) {
                Log.d("New Data Saved : ", result);
                newDataDialog.dismiss();
            }else{
                Log.e("Error:", e.getMessage());//always getting bas json response error here. 
            }
        }
    });

Can you provide your cloud code for the SaveNewData function?

I got same issue and I fixed it by adding "/" to the end of server.
"http://10.0.2.2:1337/parse" -> "http://10.0.2.2:1337/parse/"
Hope it will help you

Yes, That resolved this issue.

I just encountered the same issue, perhaps the wiki guide should be updated?

I updated the wiki this morning to include the trailing slash.

馃憤馃徎 thanks a lot

wow thank you guys, I was pulling my remaining hair out on this one!!

It works.

Was this page helpful?
0 / 5 - 0 ratings