1

I know that this question has some replies as in:

one

two

three

I'm using Android Studio:

so i have this lib in libs folder: Project libs

module libs

I've modified build.gradle:

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'

repositories {
mavenCentral()
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"

defaultConfig {
    minSdkVersion 11
    targetSdkVersion 18
}
}

dependencies {
    compile 'com.android.support:appcompat-v7:18.0.0'
    compile 'com.google.android.gms:play-services:3.1.36'
    compile files ('libs/commons-net-3.3.jar')
}

This activity uses my ftp:

...
import org.apache.commons.net.ftp.*;

public class GalleryActivity extends Activity {

private TextView debugText;
private FTPClient ftpClient;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gellery);
    // Show the Up button in the action bar.
    setupActionBar();
    debugText =  (TextView) findViewById(R.id.debug_text);
    try {

        ftpClient = new FTPClient();
        ftpClient.connect("ftp.strefa.pl");
        Toast toast = Toast.makeText(getApplicationContext(),
                "polaczono",Toast.LENGTH_SHORT);
        toast.show();
        ftpClient.login("admin+ftpforproject.strefa.pl","studia12");
        toast = Toast.makeText(getApplicationContext(),
                "zalogowano",Toast.LENGTH_SHORT);
        toast.show();
        ftpClient.enterLocalPassiveMode();
        FTPFile[] fileList = ftpClient.listFiles();

        String fileNames = "";

        for(FTPFile file : fileList){
            fileNames+= file.getName() +"\n";
        }
        debugText.setText(fileNames);

    }catch (Exception e) {
        e.printStackTrace();
    }



}
...

I know that something is wrong, because I dont have it in external library:

external library

I've added google services library and it works, my map is rendering, but in Gallery I don't have this luck.

What have I done wrong? I'm very frustrated, please help!

4

1 回答 1

2

After some time I've restarted IDE and rebuild a project (clean and build), problem solved. I don't know what to say, dummy Android Studio:/

于 2013-11-04T20:17:23.217 回答