Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8822841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:12:26+00:00 2026-06-14T06:12:26+00:00

I am working on a project. My project first step connect to ftp. I

  • 0

I am working on a project. My project first step connect to ftp. I read documentation and searched in stackoverflow but i did not find a solution.
I am beginner for android developer. When run application i saw fatal errors below LogCat and java files.How can i fix that please help me this project very important for me.

logcat:

11-03 04:27:37.640: E/AndroidRuntime(330): FATAL EXCEPTION: main
11-03 04:27:37.640: E/AndroidRuntime(330): java.lang.NoClassDefFoundError: org.apache.commons.net.ftp.FTPClient
11-03 04:27:37.640: E/AndroidRuntime(330):  at com.example.cka.MainActivity$1.onClick(MainActivity.java:33)
11-03 04:27:37.640: E/AndroidRuntime(330):  at android.view.View.performClick(View.java:2408)
11-03 04:27:37.640: E/AndroidRuntime(330):  at android.view.View$PerformClick.run(View.java:8816)
11-03 04:27:37.640: E/AndroidRuntime(330):  at android.os.Handler.handleCallback(Handler.java:587)
11-03 04:27:37.640: E/AndroidRuntime(330):  at android.os.Handler.dispatchMessage(Handler.java:92)
11-03 04:27:37.640: E/AndroidRuntime(330):  at android.os.Looper.loop(Looper.java:123)
11-03 04:27:37.640: E/AndroidRuntime(330):  at android.app.ActivityThread.main(ActivityThread.java:4627)
11-03 04:27:37.640: E/AndroidRuntime(330):  at java.lang.reflect.Method.invokeNative(Native Method)
11-03 04:27:37.640: E/AndroidRuntime(330):  at java.lang.reflect.Method.invoke(Method.java:521)
11-03 04:27:37.640: E/AndroidRuntime(330):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-03 04:27:37.640: E/AndroidRuntime(330):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-03 04:27:37.640: E/AndroidRuntime(330):  at dalvik.system.NativeStart.main(Native Method)
11-03 04:27:40.810: I/Process(330): Sending signal. PID: 330 SIG: 9

—

main activity:

    Button btn = (Button) findViewById(R.id.button1);
    final TextView tv = (TextView) findViewById(R.id.textView1);        
    btn.setOnClickListener(new View.OnClickListener() {         
    public void onClick(View v) {
        // TODO Auto-generated method stub
        core f = new core();
        f.mFTPClient = new FTPClient();
        f.ftpConnect("**.***.***.**", "****", "****", 21);
        try {
            tv.setText(f.ftpStatus());
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    });

—

core.java

package com.example.cka;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.commons.net.ftp.*;
import android.util.Log;

public class core {


    private static final String TAG = null;
    public FTPClient mFTPClient = null;

    public boolean ftpConnect(String host, String username,String password, int port){

        try {
            mFTPClient = new FTPClient();
            // connecting to the host
            mFTPClient.connect(host, port);

            if (FTPReply.isPositiveCompletion(mFTPClient.getReplyCode())) {
            boolean status = mFTPClient.login(username, password);

            mFTPClient.setFileType(FTP.BINARY_FILE_TYPE);
            mFTPClient.enterLocalPassiveMode();

            return status;
            }
        }    

        catch(Exception e) {
            Log.d(TAG, "Error: could not connect to host " + host );
        }

        return false;
    }



    public boolean ftpDisconnect()
    {
        try {
            mFTPClient.logout();
            mFTPClient.disconnect();
            return true;
        } catch (Exception e) {
            Log.d(TAG, "Error occurred while disconnecting from ftp server.");
        }

        return false;
    }

    public String ftpStatus() throws IOException{

            String status = mFTPClient.getStatus();
            return status;
    }       
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:12:28+00:00Added an answer on June 14, 2026 at 6:12 am

    org.apache.commons.net.ftp.* doesn’t seem to be included in the android APIs. Try adding the library to your project /libs folder.

    EDIT: Is your FTP library included in the build path? Right-click on the project and go to Properties->Java Build Path->Libraries, click Add JARs, and add your library from the project’s /libs folder. Then click on Order and Export and make sure it’s checked to include it in your application when it is build.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am working on my first Ajax Project and i cannot find a solution
I'm working on a very simple first step of a project I'm doing: a
i am working inapp-purchase project and first time for creating inapp-purchase in new app
I'm working on my first project in which I'm utilizing PHPUnit for unit testing.
Working on my first Rails project, I used Ryan Bates' Nifty-Generators to create the
I'm working on a project in MVC 3 (first time using!). One question I
I'm working on a first symfony project, i am using the sfWidgetFormTextareaTinyMCE widget for
I'm working on my first PHP project, and it's going well. I've been able
I'm working on a project about Data structures. In the first , I wrote
I working on my first ASP.net MVC project and and i got some problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.