Java Apache Mina FTP Server import libraries

萝らか妹 提交于 2019-12-11 15:04:09

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/23476431/java-apache-mina-ftp-server-import-libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!