我正在Android中练习FTP的方法,但我无法正确掌握。它总是在以下命令中失败:
FtpClient mFTPClient = new ();
我使用'import org.apache.commons.net.ftp.*;' 一开始,它包含在 Properties/Java Build Path/Add External Jars, ...
但我不断收到此错误消息:
10-29 12:06:01.245: E/dalvikvm(825): Could not find class 'org.apache.commons.net.ftp.FTPClient', referenced from method com.example.pruebaftp233_3.MetodosFTP.ftpConnect
10-29 12:06:01.271: W/dalvikvm(825): VFY: unable to resolve new-instance 494 (Lorg/apache/commons/net/ftp/FTPClient;) in Lcom/example/pruebaftp233_3/MetodosFTP;
10-29 12:06:01.271: D/dalvikvm(825): VFY: replacing opcode 0x22 at 0x0000
10-29 12:06:01.275: D/dalvikvm(825): VFY: dead code 0x0002-0006 in Lcom/example/pruebaftp233_3/MetodosFTP;.ftpConnect (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Z
10-29 12:06:01.435: D/AndroidRuntime(825): Shutting down VM
10-29 12:06:01.435: W/dalvikvm(825): threadid=1: thread exiting with uncaught exception (group=0x40015560)
10-29 12:06:01.455: E/AndroidRuntime(825): FATAL EXCEPTION: main
10-29 12:06:01.455: E/AndroidRuntime(825): java.lang.NoClassDefFoundError: org.apache.commons.net.ftp.FTPClient
10-29 12:06:01.455: E/AndroidRuntime(825): at com.example.pruebaftp233_3.MetodosFTP.ftpConnect(MetodosFTP.java:21)
10-29 12:06:01.455: E/AndroidRuntime(825): at com.example.pruebaftp233_3.MainActivity.onCreate(MainActivity.java:21)
10-29 12:06:01.455: E/AndroidRuntime(825): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-29 12:06:01.455: E/AndroidRuntime(825): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
10-29 12:06:01.455: E/AndroidRuntime(825): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
10-29 12:06:01.455: E/AndroidRuntime(825): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
10-29 12:06:01.455: E/AndroidRuntime(825): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
10-29 12:06:01.455: E/AndroidRuntime(825): at android.os.Handler.dispatchMessage(Handler.java:99)
10-29 12:06:01.455: E/AndroidRuntime(825): at android.os.Looper.loop(Looper.java:123)
10-29 12:06:01.455: E/AndroidRuntime(825): at android.app.ActivityThread.main(ActivityThread.java:3683)
10-29 12:06:01.455: E/AndroidRuntime(825): at java.lang.reflect.Method.invokeNative(Native Method)
10-29 12:06:01.455: E/AndroidRuntime(825): at java.lang.reflect.Method.invoke(Method.java:507)
10-29 12:06:01.455: E/AndroidRuntime(825): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-29 12:06:01.455: E/AndroidRuntime(825): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-29 12:06:01.455: E/AndroidRuntime(825): at dalvik.system.NativeStart.main(Native Method)
任何人都可以帮助我吗?谢谢!!