Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalAccessError - HawkBuilder.getParser #223

Open
cschua opened this issue Jul 30, 2018 · 1 comment
Open

IllegalAccessError - HawkBuilder.getParser #223

cschua opened this issue Jul 30, 2018 · 1 comment

Comments

@cschua
Copy link

cschua commented Jul 30, 2018

We are seeing this in our NewRelic crash reporting:

com.orha...kBuilder | HawkBuilder.java line 86 in com.orhanobut.hawk.HawkBuilder.getParser()
com.orha...awk.Hawk | Hawk.java line 27 in com.orhanobut.hawk.Hawk.build()
com.orha...kBuilder | HawkBuilder.java line 109 in com.orhanobut.hawk.HawkBuilder.build()

and also a subsequent crash report

com.orha...onParser | GsonParser.java line 26 in com.orhanobut.hawk.GsonParser.toJson()
com.orha...onverter | HawkConverter.java line 33 in com.orhanobut.hawk.HawkConverter.toString()
com.orha...wkFacade | DefaultHawkFacade.java line 33 in com.orhanobut.hawk.DefaultHawkFacade.put()
com.orha...awk.Hawk | Hawk.java line 39 in com.orhanobut.hawk.Hawk.put()

This seems to be happening when the app restarts and Hawk.init is called again. Should we only call Hawk.init once per app launch? And if the app relaunches from background or from another app, it shouldn't need to call Hawk.init again?

@crackthecodeabhi
Copy link

Hi, yes, you should call Hawk.init just once per app launch. Preferably in your Application class.
Calling it twice is unnecessary. Share the stacktrace to help better understand the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants