ParseInstaller.getCurrentInstallation().saveInBackground() is freezing my application

android, parse-platform

Solution

I encountered the same problem as well using Parse SDK 1.5.1.

And I just downloaded the latest SDK 1.6.0 and problem solved.

Link to download the latest SDK.

Problem

I am finding that about 1/5 of my tests are freezing, and after some searching for the problem I have narrowed it down to the line: ParseInstallation.getCurrentInstallation().saveInBackground(); I am using Parse 1.5.1, and an Android 4.4.2 device. My application class looks like: ``` public class InitApplication extends Application { @Override public void onCreate() { super.onCreate(); Parse.initialize(this, "my_App_ID", "my_Client_Key"); PushService.setDefaultPushCallback(this, MainActivity.class); System.out.println("execution DOES reach here"); ParseInstallation.getCurrentInstallation().saveInBackground(); System.out.println("execution DOES NOT reach here"); } } ``` The behaviour on my device is that I will first see a blank white screen for about 5 seconds, and then the screen goes black. I am not sure how long the screen stays black, as I usually force close. I've let it sit for about 10 minutes once with no change. I am unable to press the back button and any touch on the screen does nothing. I am forced to use my home button, then force the application to close. Upon reopening the application, it behaves and functions normally. Further research led me to find this post: https://www.parse.com/questions/android-saveinbackground-lock-the-main-thread But still, I have been unable to find a solution. One suggestion in the above post is to simply move the location of this code. I have tried this to some point after my main activity's onCreate() method (not to be confused with the application's onCreate() method). Behaviour appeared to be normal up until I got to the point where the getCurrentInstallation.saveInBackground() code is called, where my application froze and failed to respond until I forced it closed. Are there any solutions to this problem?

Original source