weupnp icon indicating copy to clipboard operation
weupnp copied to clipboard

Don't work on android

Open MaximeLimone opened this issue 8 years ago • 5 comments

Hello,

Your work is fabulous !!! But it don't work on android for me, weupnp never find the gateway... Moto X Pure - Android 6.0

MaximeLimone avatar May 31 '16 15:05 MaximeLimone

Hi, I had similar problem and after add printing stack traces found out it related to: From adb output: Can't create default XMLReader; is system property org.xml.sax.driver set? To fix you have to explicitly create factory: SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); SAXParser newSAXParser = saxParserFactory.newSAXParser(); XMLReader parser = newSAXParser.getXMLReader(); Instead of XMLReader parser = XMLReaderFactory.createXMLReader(); Will prepare fix soon.

a-pavlov avatar Oct 11 '16 19:10 a-pavlov

Thank you @a-pavlov! Can you confirm the fix will work also on non-android systems?

abahgat avatar Oct 12 '16 17:10 abahgat

Hi @abahgat , it definitely works on Windows. I've created pull request with fix.

a-pavlov avatar Oct 12 '16 17:10 a-pavlov

Hi, you should specify the Sax driver by using:

System.setProperty("org.xml.sax.driver", "org.xmlpull.v1.sax2.Driver");

this way it is working with no modification to the original code. Thanks.

ghost avatar Mar 11 '17 10:03 ghost

I can confirm that the fix by @ghost works on Android. I have not tested on other systems

frikksol avatar Jun 28 '18 11:06 frikksol