Announcement Announcement Module
No announcement yet.
Cannot convert Java project to Android project in STS 2.7.1 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot convert Java project to Android project in STS 2.7.1

    I have updated my STS 2.6.1 with Android plugin to 2.7.1 and context menu item Android Tools have disappeared. As a result I cannot convert plain Java project to Android project. Reinstallation of the Android plugins haven't helped.

    What is the way to fix this or is there any other way to convert plain Java project to Android project?

  • #2
    @Imivan, the Android context menu only displays on Android projects. I've got STS 2.7.1 on one machine and an older version on another machine. Both of them do not display the android context menu on standard java projects. I'm not sure of an easy way to do what you are asking. One possible option is to add an AndroidManifest.xml file to the project directory and create a new Android project from existing source. Another option that may work is to manually edit the eclipse classpath and project files to include the android specific settings. For both of those options you'll probably want to look at an existing eclipse android project setup.


    • #3
      Thank you for your reply, rclarkson.

      I solved my problem by adding .project file with android settings to project.

      But I want to tell you why my first post had appeared.
      My friend and I developed android application with maven and we exchange our source code using Git. In .gitignore we are added .classpath, .settings, */gen and .project files/folder, because we think that STS generates this file automatically when project is imported to STS (Is it right?). Then after I pulled project from git hub and tried import it to STS 2.6.1/2.7.1 like Existing maven project, STS 2.6.1/2.7.1 doesn't show this project like android/maven project, it shows like Java/maven project. But in STS 2.6.1 when I called context menu for this imported project, "Android Tools" menu item presents and I can select "Convert to Android project" in STS 2.7.1 I cannot do that. This is all my story

      Thank you for your time, rclarkson.

      P.S. STS 2.7.1 updated from STS 2.6.1
      Last edited by Imivan; Jul 22nd, 2011, 01:27 AM.


      • #4
        Ok, I understand what you are saying. It is good practice not to keep those files in git, since they are based on environment. We do not include the eclipse project files in our git repositories either. Since you are using the Maven Android Plugin, you can import the project as an existing Maven project.

        1. File -> Import...
        2. Maven -> Existing Maven Projects
        3. Navigate to the root directory of your project and click Next, and the project should import
        4. Right click on the project -> Selected Android Tools -> Fix Project Properties
        5. Finally, I recommend removing the JRE System Library classpath container, right click the project -> Properties -> Java Build Path -> Libraries (Tab). Select the JRE System Library and remove it.

        Hope that helps!