Ali
Ali

Reputation: 3615

com.parse.ParseRequest$ParseRequestException: bad json response (When I moved parse server to Heroku)

I have moved parse server on heroku and also database from parse.com to mangolab. I'm getting following error when I make request from my android app.

com.parse.ParseRequest$ParseRequestException: bad json response

App request

ParseQuery<ParseObject> query = ParseQuery.getQuery("sport");
            query.findInBackground(new FindCallback<ParseObject>() {
''''''''''''
...........    
});

Note: - 1. I'm using android parse sdk(v1.13.0)
- 2. Android studio
- 3. My Parse initialization code is

Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
              .applicationId("mTAb2txgEHPy4fbxxxx").clientKey("KpKKNtKxxxxxPsppS0ovA")
                .server("http://raxxx-beyond-20009.herokuapp.com/parse").build());


- 4. I've added following Permission in Manifest file

uses-permission android:name="android.permission.INTERNET" 
uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"


- 5. I've following below article and implemented everything like this. https://learnappmaking.com/how-to-migrate-parse-app-parse-server-heroku-mongolab/


- 5.1. I also also my mongodb connection string in my heroku account(heroku.com) and it is showing correct.
- 5.1.2 - I also confirmed my heroku account url(that I'm passing during initialization of parse in point 3)


- 6. I have also tried to use parse android sdk (v1.12.0) but no success.(parse.initilize(........).server(....) is not implemented in this version)

-7. build.gradle(Module:app)

compile files('libs/Parse-1.13.0/Parse-1.13.0.jar')

Upvotes: 3

Views: 2888

Answers (1)

Slagathor
Slagathor

Reputation: 892

You have to add an "/" to the end of your server-url. After /parse

Like this. "http://raxxx-beyond-20009.herokuapp.com/parse/"

Hope that helps.

Check out this issue for more information. https://github.com/ParsePlatform/Parse-SDK-Android/issues/382

Upvotes: 15

Related Questions