E/SmackConfiguration﹕ Could not determine Smack version
java.lang.NullPointerException
at java.io.Reader.(Reader.java:64)
at java.io.InputStreamReader.(InputStreamReader.java:122)
at java.io.InputStreamReader.(InputStreamReader.java:59)
at org.jivesoftware.smack.SmackConfiguration.(SmackConfiguration.java:102)
at org.jivesoftware.smack.ConnectionConfiguration.(ConnectionConfiguration.j ava:67)
I imported asmack source to android studio and use gradle to compile.
My App is a android app, my app depend on asmack for IM chat.
import successfully, compile successfully, but run app in android system, I got error stack above.
the resonse is BufferedReader reader = new BufferedReader(new InputStreamReader(FileUtils.getStreamForUrl(“classpath:org.jivesoftware.smack/v ersion”, null)));
can not read version file in package. I don’t know how to resolve it. Please help me!
While I welcome this goal, I believe Android Studio does now support debugging with source attachments (at least that’s what I was told, since I don’t use AS I did not verify), therefore I would not suggest manually adding the source. Instead configure Smack 4.1’s maven artifacts. Then either tell gradle to attach the sources, or manually add them. And you may want to use Smack 4.1. But I would recommend studying 4.1 anyways, as many things have changed from 4.0.
Also, consider not using Android when playing around and studying Smack. Instead use a standard java project. The Android specific code of Smack is only a few LOCs compared to the rest, so it’s best to get rid of that layer. It also has the advantage that you can debug/study using a standard JVM and don’t have to use an real Android device or Emulator.
You may want to try Flowdalic/smack-examples · GitHub , setting the project up in eclipse is as easy as “gradle eclipse” + “eclipse: import project”. From there you can use an debugger to set breakpoints and step through the code.