2

I migrated project from Eclipse to Android Studio. App compiles fine, but it has a crash related to nekohtml library.

Inside HTMLEntities class

//filename = "res/HTMLlat1.properties"
final InputStream stream = HTMLEntities.class.getResourceAsStream(filename);

stream is always null. I tried to move file to the same folder as class and gave full path like this

filename = "/org/cyberneko/html/res/HTMLlat1.properties"

Any ideas?

Minas
  • 1,422
  • 16
  • 29

1 Answers1

1

You should use filename = "/org/cyberneko/html/res/HTMLlat1.properties" instead of filename = "/org.cyberneko.html/res/HTMLlat1.properties" or use relative paths. This could be explained in this way: jar (jar is an example, maybe you're running your code from *.class in some directory) is just some kind of file system with it's root ("/") and all the files in the packages are in some subdirectories and you should specify the paths for them.

Dmitry Ginzburg
  • 7,391
  • 2
  • 37
  • 48