0

I am having an issue in Eclipse. If I create a project, then delete it and check the "Delete project contents on disk (cannot be undone)" check box, a project created afterwards with the exact same name and settings will not be created with a MainActivity.java file.

If I create a project then delete it without checking that box, it can be recreated with the MainActivity.java file but will require you to open and save the fragment_main XML file before the project can be deleted again (with or without checking the check box).

What is happening here? Why does it behave in this way?

Zach H
  • 257
  • 1
  • 3
  • 15

2 Answers2

1

@Zach H When deleting a project give you two options(The dialog box will ask your confirmation for deleting from workspace or not)

  1. Simple Delete
  2. Delete from workspace

Under simple delete- As you delete a project then the project gets deleted in the Package Explorer but is still present in your workspace directory (i.e. the path where your projects are stored) because you didn't select delete from workspace option.

Under Delete from workspace- When you confirm the option delete from workspace then you project gets deleted from your hard disk as well.

When you simply choose delete then you can create a same project with same activity because the project with same name is not there in the package explorer. Only if the same project already exists then you will get an error asking you to rename your project.

The above said problem happens only when you have not installed the ADT/Eclipse properly(missing some files from the SDK Manager).

My suggestion for you is that you first install all the packages from the tools because a missing support tool could coz such problem as above

user285oo6
  • 315
  • 3
  • 18
  • Completely reinstalled the SDK then confirmed that all tools were installed, yet the problem still persists. – Zach H Jul 03 '14 at 23:03
  • @ZachH which version did of SDK And the ADT have you installed 22.6 or the 23.0 – user285oo6 Jul 04 '14 at 06:45
  • I now have ADT 23, and now the **MainActivity.java** and the **activity_main.xml** files are not created in _any_ new projects. I believe it's an issue with the ADT plugins. I tried the update plugins solution [here](http://stackoverflow.com/questions/22243651/src-folder-in-eclipse-is-empty-mainactivity-class-not-created-after-creating-a), but it gave me a "conflicting dependencies" error. I am also unable to uninstall the current plugins without uninstalling Eclipse, an issue that others have mentioned but I have not seen a solution for. – Zach H Jul 04 '14 at 07:14
  • 1
    @ZachH It seems you have installed the wrong and a very bug full version of ADT. Please read this for eclipse plugin revert(http://stackoverflow.com/questions/24445894/android-development-tool-23-0-0-and-android-l-update-error-in-eclipse) or this for the ADT version(http://stackoverflow.com/questions/24525595/this-android-sdk-requires-android-developer-toolkit-version-23-0-0-or-above/24526765#24526765)delete the 23.0 and install only 22.6 – user285oo6 Jul 04 '14 at 07:24
  • Those links were very helpful. The issues I had were a result of some bugs in the new ADT. The only thing that solved my problem was downloading Eclipse, the ADT, and the SDK separately (not the ADT bundle). – Zach H Jul 05 '14 at 02:08
0

When you delete a Eclipse project this is what happens:

If you choose delete on disk - You delete the project and the files from the PC.

If you don't choose delete on disk - You only delete the project from eclipse but the files still there, so if you create a new project with the same name them put automatically.

For this case when you need some files from old projects, So, the best way is import or export projects.

I hope this help you.

MarmiK
  • 5,639
  • 6
  • 40
  • 49
josedlujan
  • 5,357
  • 2
  • 27
  • 49