title: Unable to create service com.parse.PushService: java.lang.NullPointerException
body: <p>I am using service <a href="https://www.parse.com" rel="nofollow">https://www.parse.com</a> for push notifications. 
  The error only appears when the application is closed. On the other hand, the error does not seem to appear when the application is active. </p>
  
  <p>My code:</p>
  
  <pre><code> ParseCrashReporting.enable(this);
  
              // Enable Local Datastore.
              Parse.enableLocalDatastore(this);
  
              Parse.initialize(this, "cMQIGJhjD58Dn3uQ27nx5NsO***", "f0VtuHy2G1NsWUPrfzkzJjh7523UDnqX7cQav****");
              ParseInstallation.getCurrentInstallation().saveInBackground();
  
              ParseUser.enableAutomaticUser();
              ParseACL defaultACL = new ParseACL();
              // Optionally enable public read access.
              // defaultACL.setPublicReadAccess(true);
              ParseACL.setDefaultACL(defaultACL, true);
  </code></pre>
  
  <p>AndroidManifest</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.home.smart.home" &gt;
  
  
      &lt;permission
          android:name="com.home.smart.home.permission.MAPS_RECEIVE"
          android:protectionLevel="signature" /&gt;
  
      &lt;uses-permission android:name="com.home.smart.home.permission.MAPS_RECEIVE" /&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;!-- Push --&gt;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
      &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
      &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
      &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
      &lt;!-- end Push --&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
      &lt;uses-permission android:name="android.permission.READ_PHONE_STATE"&gt;&lt;/uses-permission&gt;
      &lt;uses-permission android:name="android.permission.BLUETOOTH"/&gt;
  
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
      &lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;
  
      &lt;uses-permission android:name="android.permission.CAMERA"/&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  
      &lt;!-- end Push --&gt;
      &lt;permission android:protectionLevel="signature"
          android:name="com.home.smart.home.permission.C2D_MESSAGE" /&gt;
      &lt;uses-permission android:name="com.home.smart.home.permission.C2D_MESSAGE" /&gt;
      &lt;!-- Push --&gt;
  
      &lt;!-- Required OpenGL ES 2.0. for Maps V2 --&gt;
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;!-- Goolge API Key --&gt;
          &lt;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="AIzaSyB0gzAqr_M4y_Iy3_xq6yvu17zpkG7V_IU" /&gt;
  
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
  
          &lt;!-- Push --&gt;
  
          &lt;service android:name="com.parse.PushService" /&gt;
          &lt;receiver android:name="com.parse.ParseBroadcastReceiver"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
                  &lt;action android:name="android.intent.action.USER_PRESENT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
          &lt;receiver android:name="com.parse.ParsePushBroadcastReceiver"
              android:exported="false"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.parse.push.intent.RECEIVE" /&gt;
                  &lt;action android:name="com.parse.push.intent.DELETE" /&gt;
                  &lt;action android:name="com.parse.push.intent.OPEN" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
          &lt;receiver android:name="com.parse.GcmBroadcastReceiver"
              android:permission="com.google.android.c2dm.permission.SEND"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
  
                  &lt;!--
                    IMPORTANT: Change "com.parse.starter" to match your app's package name.
                  --&gt;
                  &lt;category android:name="com.home.smart.home" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  
          &lt;meta-data android:name="com.parse.push.notification_icon"
              android:resource="@drawable/abc_btn_rating_star_on_mtrl_alpha"/&gt;
  
          &lt;!-- end Push --&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>The error message from Logcat is:</p>
  
  <pre><code>Unable to create service com.parse.PushService: java.lang.NullPointerException
  </code></pre>