ibm-bluemix-mobile-services / bms-clientsdk-android-push

Android Push notifications SDK for IBM Cloud Mobile Services
Apache License 2.0
10 stars 12 forks source link

Random NPE in accessing getDevicesUrl Method. #81

Open sairajkishore opened 6 years ago

sairajkishore commented 6 years ago

Hi,

Am getting below random crash due to null pointer exception as below, could you let me know the reason for this? is there any fix available for this?

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at java.lang.AbstractStringBuilder.(AbstractStringBuilder.java) at java.lang.StringBuilder.(StringBuilder.java) at com.ibm.mobilefirstplatform.clientsdk.android.push.internal.MFPPushUrlBuilder.getDevicesUrl(Unknown Source) at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush.sendMessageDeliveryStatus(Unknown Source) at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushIntentService.setAppForeground(Unknown Source)

AnanthaKrish commented 6 years ago

@sairajkishore Let me look into this issue .... I will get back to you soon..

AnanthaKrish commented 6 years ago

@sairajkishore is this issue 80 happening at the same time ?

sairajkishore commented 6 years ago

No both are different issues but randomly occurring.

sairajkishore commented 6 years ago

Hi ,is above mentioned issue is fixed? available?

AnanthaKrish commented 6 years ago

@sairajkishore I am not able to recreate this issue ... do you have anymore logs ?

sairajkishore commented 6 years ago

Hi, below are the logs i found this may be useful.

UnRegister logs Error unregistering with bluemix:com.ibm.mobilefirstplatform.clientsdk.android.push.api.a: , Message : {"code":"FPWSE0001E","message":"Not Found - The target resource 'PushDevice' does not exist. Check the 'ee335bad-a042-3f93-8b6c-5010b444870c' parameter."}, statusCode : 404

Error unregistering with bluemix:com.ibm.mobilefirstplatform.clientsdk.android.push.api.a: , Message : java.net.UnknownHostException: Unable to resolve host "imfpush.ng.bluemix.net": No address associated with hostname, statusCode : 0

Error unregistering with bluemix:com.ibm.mobilefirstplatform.clientsdk.android.push.api.a: , Message : java.net.SocketTimeoutException: timeout, statusCode : 0

AnanthaKrish commented 6 years ago

@sairajkishore How you are adding the region ?

sairajkishore commented 6 years ago

This is how am adding the region. BMSClient.getInstance().initialize(mContext, BMSClient.REGION_US_SOUTH);

AnanthaKrish commented 6 years ago

I think its a network issue . @sairajkishore are you getting this error every time ?

sairajkishore commented 6 years ago

Not every time but for some user's.

On Nov 24, 2017 12:07 AM, "Anantha Krishnan K G" notifications@github.com wrote:

I think its a network issue . @sairajkishore https://github.com/sairajkishore are you getting this error everytime ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-push/issues/81#issuecomment-346743909, or mute the thread https://github.com/notifications/unsubscribe-auth/AcbIFrszcpo_1zcXWr9B9WAroEDKRWr_ks5s5k73gaJpZM4O0GrY .

AnanthaKrish commented 6 years ago

Its looks like the network issue .