1

Im trying to create an Android project on Eclipse but as soon as i create it, errors appear on the project name.

I dont know whats wrong since I havent written anything myself yet. When when im on the final step of the project creation window (the activity section), I click finish and it takes like 5 seconds and the project name appears on the left, in the project explorer but the window doesnt close.

Heres what it looks like:

enter image description here

Here's the result of the Problems tab:

enter image description here

Ahmad
  • 69,608
  • 17
  • 111
  • 137
ninesalt
  • 4,054
  • 5
  • 35
  • 75

6 Answers6

2

When you have errors like R cannot be resolved to a variable most of the times you have to solve problems in your Resources, for example you can see the folder \res has a red cross, solve that problems first.

Jorgesys
  • 124,308
  • 23
  • 334
  • 268
  • The problems in the /res folder are in the values, values-v11 and values-14 folder. All of them are errors on XML files, which to be honest I dont know how to fix. – ninesalt May 20 '14 at 20:18
1

Do the below changes and I guess it should work.

  1. Update ADT & SDK.
  2. Remove gen folder , and create it again .
  3. Do a clean-project.
  4. Right click the project and choose android-tools -> fix-project-properties .
  5. Right click the project and choose properties -> java-build-path -> order-and-export. make sure the order is :
  6. Android private libraries
  7. Android dependencies
  8. Your library project's if needed
  9. yourAppProject/gen
  10. yourAppProject/src
  11. Make sure all files in the res folder's subfolders have names that are ok : only lowercase letters, digits and underscore ("_") .
  12. Always make sure the targetSdk is pointed to the latest API (currently 18) , and set it in the project.properties file

If above doesn't work then try next method 2 given below:

The step to solve the issues is easy. You just mouse point to your project folder (Example: SampleAndroid), then right click and now choose “Build Project”. Your all project will rebuild.

Once rebuild complete, you can see that the error icon was disappear on the MainActivity.java code. Now you can run your application in Emulator.

Indrabhushan
  • 98
  • 10
0

Maybe try "Project->clean" in order to rebuild.

user3658206
  • 33
  • 1
  • 4
0

First of all check the Problems tab that will you show you what may cause this. Also clean your project as it might solve some issues.

drk
  • 398
  • 4
  • 13
  • Heres the problems tab : http://i.imgur.com/qViJUNP.png and cleaning the project didnt change anything. – ninesalt May 20 '14 at 20:15
  • Make sure you imported the support library correctly. This might help: http://stackoverflow.com/questions/17870881/cant-find-theme-appcompat-light-for-new-android-actionbar-support http://stackoverflow.com/questions/18830736/actionbaractivity-cannot-be-resolved-to-a-type http://stackoverflow.com/questions/18299898/the-import-android-support-cannot-be-resolved – drk May 20 '14 at 20:19
0

I also faced the same problem and solved it by deleting appcompatv4 file from libs folder. Try it, it might help to you.

0

I have this problem, finally,I solved this by opening my SDK manager → download Android support in Extras,you can try. check your Android support is installed, and then you can build a new project without errors. Android sdk details

Raju
  • 2,902
  • 8
  • 34
  • 57