3

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')
4
  • Try app engine medium.com/google-cloud/… Commented Feb 2, 2016 at 4:01
  • Have you setup Parse Server on Heroku? That could be your issue. You need the NodeJS Parse API Server running to allow your app to connect to the Mongo database. Commented Feb 2, 2016 at 9:33
  • I have already setup Parse Server on Heroku. (I mentioned this in point 5) Commented Feb 2, 2016 at 10:17
  • See if this thread helps, especially the REST API mentioned. Can you see the JSON data that is sent back and forth? Use a proxy like Charles. github.com/ParsePlatform/Parse-SDK-Android/issues/334 Commented Feb 2, 2016 at 14:58

1 Answer 1

15

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

Sign up to request clarification or add additional context in comments.

1 Comment

It's so easy, but just easy to make mistake

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.