Tuesday, February 10, 2015

Fix Parse 101 Error object not found for update

parse-com-cloud-screenshot


Parse.com is one of leading cloud service provider. I implemented push notifications in an ODesk based freelance client's app last year. They returned with some more work (I love returning clients!) and a request for updating the old app to latest Parse.com APIs. Latest Parse API version number is 1.8.2 at time of this writing.

I opened Parse.com documentation and started following it for sake of update. Several old methods have been deprecated from the API. For example the method
        PushService.subscribe();

Google's Mindset about adopted children Mozilla Firefox & Eclipse IDE

I had to switch from Eclipse IDE to Android Studio which is the new Google darling for writing code. Google did the same thing with Mozilla Firefox browser a few years back, they kept feeding Firefox to fight bloody battles with Microsoft Internet Explorer while they were conceiving their own child 'Chrome'. Once their own thing was in good shape, they kicked the adopted open source child out of their home.







How to fix Error object not found for update code 101

While following the instructions in Parse.com documentation I pretty much hit the wall with error 101. I then downloaded their sample application and in there I found some lines of code which were not mentioned in the docs. Adding these lines to my app code (application class onCreate) fixed things right away. The magic lines of Java code are given below:

ParseCrashReporting.enable(this);

// Enable Local Datastore.
Parse.enableLocalDatastore(this);

// Add your initialization code here
Parse.initialize(this, "*******", "******");

ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();

ParseACL.setDefaultACL(defaultACL, true);

// save the installation
ParseInstallation.getCurrentInstallation().saveInBackground();

I believe my readers will have enough sanity to avoid using * strings as parameters to initialize call.

Side note, more than one Parse.com apps

I also noticed later that I already had a parse.com app installed on my phone. This was the older version of the app which I was trying to update. So, I removed the older app as well just to get over with any confusion.

Bonus, a cool code image

Last but not least, here's a bonus C code image for you. I got it from pixabay, its a royalty free image. 

source-code-code-programming-c



2 comments:

  1. As it sometimes happens with applications in the cloud, various types of errors may appear. However, they happen extremely rarely and I haven't dealt with them yet. I really like the cloudboostr solution through which I can easily put whatever I want in the cloud.

    ReplyDelete

Feel free to talk back...