powered by Jive Software

NullPointerException is asmack file incoming file transfer

I’ve been having serious issues trying to send a file to my android client from a preexisting windows client. The Windows client works fine with incoming/outgoing to other Windows Client. The android client can only send to the Windows client, it can’t recieve.

My code is

FileTransferManager manager = ``new FileTransferManager(connection);

manager.addFileTransferListener(``new FileTransferListener() {

``public void fileTransferRequest(``final FileTransferRequest request) {

``new Thread(){


``public void run() {

``IncomingFileTransfer transfer = request.accept();

``File mf = Environment.getExternalStorageDirectory();

``File file = ``new File(mf.getAbsoluteFile()+``"/DCIM/Camera/" + transfer.getFileName());



``while``(!transfer.isDone()) {



``}``catch (Exception e) {

``Log.e(``""``, e.getMessage());


``if``(transfer.getStatus().equals(Status.error)) {

``Log.e(``"ERROR!!! "``, transfer.getError() + ``""``);


``if``(transfer.getException() != ``null``) {




``}``catch (Exception e) {

``Log.e(``""``, e.getMessage());






The code works fine in that I know the listener fires, I can use transfer.getFileName() and get FileSize to get that information, also, on my client a 0kb file is made when the file is sent from a different client (a windows client using the normal smack library)

In my android log, I get this

E/AndroidRuntime(21814): FATAL EXCEPTION: File Transfer jsi_8313049596512102350

E/AndroidRuntime(21814): java.lang.NullPointerException

E/AndroidRuntime(21814): at org.jivesoftware.smackx.filetransfer.Incoming


E/AndroidRuntime(21814): at org.jivesoftware.smackx.filetransfer.Incoming


E/AndroidRuntime(21814): at java.lang.Thread.run(Thread.java:856)

Which aSmack Version do you use?

1 Like

I’m using 0.8.6