NPE in Handling Push Service Registration

Hi there,
I am receiving some in a while NPE with this stacktrace:

java.lang.NullPointerException

at com.backendless.push.BackendlessPushService.handleRegistration (BackendlessPushService.java:220)

at com.backendless.push.BackendlessPushService.handleIntent (BackendlessPushService.java:100)

at com.backendless.push.BackendlessPushService.onHandleIntent (BackendlessPushService.java:66)

non-project frames

at android.app.IntentService$ServiceHandler.handleMessage (IntentService.java:65)

at android.os.Handler.dispatchMessage (Handler.java:99)6at android.os.Looper.loop (Looper.java:137)

at android.os.HandlerThread.run (HandlerThread.java:61)




Looking into the library that BackendlessPushService.java:220 ->

if( error.equals( GCMConstants.ERROR_SERVICE_NOT_AVAILABLE ) )

And the only previous interaction with “error” variable is:

private void handleRegistration( final Context context, Intent intent )
{
 String registrationId = intent.getStringExtra( GCMConstants.EXTRA_REGISTRATION_ID );
 String error = intent.getStringExtra( GCMConstants.EXTRA_ERROR );

So it seems that sometimes (for any reason) the intent does not contain any String error, this becomes null and so it produces the npe.
Since this is inside the library, any ideas about workaround to avoid these breaks?

What version of sdk, do you use?

3.0.25

I’m using Backendless 3 and my app ID: 2C218174-5C8D-CC02-FFDA-271D3F676400

you should use 3.1.0 http://mvnrepository.com/artifact/com.backendless/android/3.1.0

Ok I’ll give it a try to see what happens.
Where can I see the update notes between versions Sergey?

here it is release history for 4.0 https://backendless.com/products/release-history/

Please keep in mind that the free plan in Backendless 3.x will be discontinued on November 1st 2017. Unless you plan to migrate to a paid plan in 3.x, I recommend switching to version 4.0

Thanks for the tips Sergey.