-7

M using #helpshift app got crash or initializetion of help shift. please follow the logs

java.lang.RuntimeException: Unable to start service com.helpshift.support.HSRetryService@1aba47b with Intent { cmp=com.quizup.core/com.helpshift.support.HSRetryService }: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase android.content.Context.openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase$CursorFactory, android.database.DatabaseErrorHandler)' on a null object reference
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4079)
    at android.app.ActivityThread.access$2400(ActivityThread.java:221)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1897)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7224)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase android.content.Context.openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase$CursorFactory, android.database.DatabaseErrorHandler)' on a null object reference
    at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)
    at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
    at com.helpshift.support.storage.ProfilesDataSource.read(ProfilesDataSource.java:27)
    at com.helpshift.support.storage.ProfilesDataSource.getProfile(ProfilesDataSource.java:61)
    at com.helpshift.support.ProfilesManager.getProfile(ProfilesManager.java:25)
    at com.helpshift.support.ProfilesManager.getProfileId(ProfilesManager.java:34)
    at com.helpshift.support.HSApiData.getProfileId(HSApiData.java:2059)
    at com.helpshift.support.HSApiData.sendFailedMessages(HSApiData.java:1626)
    at com.helpshift.support.HSRetryService.onStartCommand(HSRetryService.java:17)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4062) 
  • check your object are properly initialized, generally you should also put your code where you are getting this error – ruben Oct 05 '17 at 11:01
  • Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a [mcve]. Use the "edit" link to improve your *question* - do not add more information via comments. Thanks! – GhostCat Oct 05 '17 at 11:03
  • But the real thing is: when you dont know what a NPE is and how to fix it ... then you should spend some serious time learning about java basics. – GhostCat Oct 05 '17 at 11:04

1 Answers1

1

Check Line Number 27 in ProfilesDataSource class. Also Comment your 'ProfilesDataSource' class code for more help.

Jatin
  • 491
  • 2
  • 12