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

java.lang.ExceptionInInitializerError Caused by: java.lang.NullPointerException: in == null at java.util.Properties.load(Properties.java:246) #46

Closed
potyl opened this issue May 11, 2015 · 4 comments · Fixed by #59

Comments

@potyl
Copy link

potyl commented May 11, 2015

I tried adding leak canary to our app and we get this crash:

java.lang.ExceptionInInitializerError
  at org.eclipse.mat.hprof.HprofIndexBuilder.fill(HprofIndexBuilder.java:54)
  at org.eclipse.mat.parser.internal.SnapshotFactory.parse(SnapshotFactory.java:193)
  at org.eclipse.mat.parser.internal.SnapshotFactory.openSnapshot(SnapshotFactory.java:106)
  at com.squareup.leakcanary.HeapAnalyzer.openSnapshot(HeapAnalyzer.java:134)
  at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:87)
  at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:56)
  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:145)
  at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: java.lang.NullPointerException: in == null
  at java.util.Properties.load(Properties.java:246)
  at org.eclipse.mat.util.MessageUtil.(MessageUtil.java:28)
  at org.eclipse.mat.util.MessageUtil.(MessageUtil.java:13)
  ... 10 more
@pyricau
Copy link
Member

pyricau commented May 11, 2015

Do you use Android Studio or Eclipse?

@potyl
Copy link
Author

potyl commented May 11, 2015

Android Studio with gradle (and proguad)

@pyricau
Copy link
Member

pyricau commented May 11, 2015

The resource file is not available in the classpath. Not sure why. We could change HAHA to just use class constants, that properties file isn't really worth anything. In the meantime, it's probably something specific about your gradle conf that prevents picking up those properties files.

@potyl
Copy link
Author

potyl commented May 11, 2015

Thanks for the pointer, I'll try to see if our gradle conf is doing something odd with the resource file.

pyricau added a commit that referenced this issue May 12, 2015
* HAHA 1.2 has no .properties resource file which should fix #46
Yky pushed a commit to Yky/leakcanary that referenced this issue Feb 21, 2016
* HAHA 1.2 has no .properties resource file which should fix square#46
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

Successfully merging a pull request may close this issue.

2 participants