I am using JSoup to parse some webpage information for my android app. Now I am also implementing this to my iOS module. The problem is it is not properly parsing there. Networking is not the problem as I can easily print the downloaded html correctly out. The problem is when I call the parse method of JSoup: It throws an exception.
java.lang.NullPointerException: Attempt to invoke virtual method ‘int java.io.Reader.read(char[])’ on a null object reference
This is somewhere inside the JSoup library and seems not to be supported for use with the iOS system of the multi os engine. I can’t really exactly tell where the problem is as decompiling the library messes somehow the lines up and they no longer match those in the exception, but I am trying to find the root of the problem.
If anyone knows what might go on there, please share your ideas!
But I just found out the problem was my jsoup version: I was still on 1.8.3 which somehow not works correctly with moe. I updated to 1.10.3 and it worked. Never had thought that this could be an issue. Really strange.
Anyway, thank you for you help!
EDIT
Actually: I am not yet done
Caused by: java.lang.IllegalStateException: Could not read resource entities-xhtml.properties. Make sure you copy resources for org.jsoup.nodes.Entities
This error occurs. I assume that pro guard is not keeping those properties files in the packages. How did you @ekuleshov solve this? The only thing I added to my proguard-rules.txt is the following:
Okay The error I posted above is just an error caused before my initial error, so still the java.lang.NullPointerException: Attempt to invoke virtual method ‘int java.io.Reader.read(char[])’ on a null object reference problem.
Anyone has got any ideas why this is happening? Or @ekuleshov could you send me the jar you are using? I actually also loaded the code as a module into my project so I could look for the error but it changes nothing. The error is just appearing on use with iOS. Android works just fine. I have no idea whats going on…