Search code examples
android-studioftp

Android Studio import org.apache.commons.net.ftp.FTP


I'm trying to import the library org.apache.commons.net.ftp.FTP but I don't know how to do it correctly. I found other posts but without updated solutions. I've already added into gradle file, the string: implementation 'org.kie.modules:org-apache-commons-net:6.5.0.Final' and also tried to download the library from: File -> ProjectStructure -> LibraryDependency but I can't find it.

Also, if I download the zip from: https://commons.apache.org/proper/commons-net/download_net.cgi I don't understand where to place it and still android studio can't find:

import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;

Solution

  • Try this:

    1. Download the "commons-net-3.9.0-bin.zip" from https://commons.apache.org/proper/commons-net/download_net.cgi
    2. Extract the zip and using Android Studio place the "commons-net-3.9.0.jar" file into your ProjectName -> App -> Libs folder
    3. Right click in the file and select at the bottom "Add As Library"

    I didn't add anything into gradle file