Question

I want to create an Android FTP Server App with the Apache Mina FTP Server.

The problem is the following: I can't import these libraries.

I can select between two errors:

If the libs aren't selected in "Java Build Path"/"Order and Export", I get this error:

"Could not find class 'org.apache.ftpserver.FtpServerFactory' (...)" 

(Logcat)

If they are selected, I get this error:

Conversion to Dalvik format failed: 
Unable to execute dex: 
Multiple dex files define Lorg/apache/ftpserver/ftplet/FtpException;

(Problems / Errors)

What's wrong??

My imported libraries:

  • ftplet-api-1.0.6.jar
  • ftpserver-core-1.0.6.jar
  • mina-core-2.0.4.jar (or 2.0.7)
  • slf4j-api-1.5.2.jar (or 1.6.6)
  • slf4j-simple-1.5.3.jar
Was it helpful?

Solution

I have the same issue with any android project when I add jCenter dependency on org.apache.ftpserver:ftpserver-core:1.0.6. Project compiles successfully, but it fails when I try to start it.

I realized, that ftpserver-core-1.0.6.jar contains classes from ftplet-api-1.0.6.jar.

To fix the issue, I used local libraries, but deleted ftplet-api-1.0.6.jar. I am not sure that it is totally correct solution, but it works for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top