Importing Existing Android Project into Eclipse

后端 未结 2 1077
旧时难觅i
旧时难觅i 2021-01-02 14:01

project.properties is being updated incorrectly when importing an Existing Android project into Eclipse. This file exists in source control:

# This file is          


        
相关标签:
2条回答
  • 2021-01-02 14:08

    import your project as you are doing ie

    Existing Android code into workspace.

    now delete the project.properties. clean and build project.

    Approach 2:

    if existing project has build.xml file import project using this ant build file import option

    New-->other-->Java Project from existing Ant file-->

    follow further option and you are done

    Approach 3

    right click your project ---> project properties go to Android Select appropriate API level. Clean and build your project .... Its done now

    0 讨论(0)
  • 2021-01-02 14:21

    For now use General -> Existing Projects into Workspace instead of the Android -> Existing Android Code into Workspace to avoid the project.properties file being auto generated improperly.

    You are correct, if your android project does not have a .classpath, the android package structure is lost. But if your android project is already an Eclipse project it should import just fine.

    This is a bug in eclipse. http://code.google.com/p/android/issues/detail?id=40161

    This excerpt explains the problem.

    "If you are importing an Eclipse project (which has a .classpath), just use the generic Eclipse project import mechanism; that's still there (Import > General > Existing Projects Into Workspace). We added Import > Android > Existing Android Code Into Workspace because a lot of people had non-Eclipse projects to import, which was not well supported; you had to "Create New" and then use a checkbox to select "existing code" etc, and the location of the project and the location of the existing sources was ambiguous. We made the Existing Android Code import option also work for Eclipse projects, such that it would be a single obvious way to pull in source code. But this is new code, not the general Eclipse builtin import code, which is why it doesn't pick up the project name in the way it used to. (The related code which handled adding new project from source did act in the same quirky way the code does now, picking a project name from the manifest). However, making it look up the project name from the .project file as a better default, if present, should be doable so I'll try to add that as well."

    0 讨论(0)
提交回复
热议问题