i have just begun working on android platform.I installed both eclipse and android sdk.Now i wanted to run a basic hello world application. I just followed a tutorial and tried to run it but got the following error your project contains errors please fix them before running your application How can i debug this and run the app on emulator please help me out
-
right click on Project properties --> select android on left side and select your android version..For Ex:- Android 2.2 – Mehul Ranpara Dec 28 '12 at 04:58
-
1Look at the Problems tab. If it's not visible then Window -> Show View -> Problems – dmon Dec 28 '12 at 04:59
-
In which part of your program error is showing???It should show red color mark..Tell that at which line it is showing?? – Subburaj Dec 28 '12 at 05:05
-
Your problem is solved or not??? – Subburaj Dec 28 '12 at 06:23
5 Answers
There are two possible problem.
Because of code
Because of R.java
Check your project for any red mark on any package, if there is any red mark check that class for compilation error, this may happen because of wrong syntax,
or if you are unable to find R.java in your code, please check your RES folder for any possible error.
If you are not able to find any such error then clean and build your project from Project-->Clean(Select your project)-->Build Your project.
If you are using any external jar file please add them in build path. right click on project-->buildpath-->configure build path-->library-->add external jar-->order them
Check your min version and max version of project in manifest file, version of project u r using.
If still you are not able to compile then post your code here we will compile for you :)

- 611
- 6
- 22
-
there is nothin like code .Im just trying to run a basic hello world blank application – sujay Dec 28 '12 at 05:49
i had to delete the debug.keystore file which is present in .android folder and had to relaunch the eclipse.that fixed my problem

- 1,845
- 9
- 34
- 55
If you have just installed the Eclipse, the most usual solution might be to Restart your Eclipse.
If it still doesnt work, then there might be some issue with your
res
folder, Check that-- There should not be duplicate files in the
layout
,Drawable
folders and otherres
sub folders. - No name in the
res
folders should s=have capital letters in it.
- There should not be duplicate files in the
Remove, if any import android.R;
Also, have a look at this Answer, R.java not resolved error

- 1
- 1

- 11,033
- 8
- 53
- 100
-
i have a error in res folder and that too in styles.xm which is present in values folder error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'. – sujay Dec 28 '12 at 05:49
-
i have three values folder in my project i.3 values ,values-v11 and values-v14. – sujay Dec 28 '12 at 05:56
-
you dont need all three for a hello world program, keep only values folder and delete the rest two. – Sahil Mahajan Mj Dec 28 '12 at 05:59
-
yeah i did.. now im getting error in menu folder i.e activity_main.xml error: No resource identifier found for attribute 'showAsAction' in package 'android' – sujay Dec 28 '12 at 06:00
-
-
it was generated automatically.and i deleted it now but now my project name has a red error mark on it and its not on any of its sub folders. – sujay Dec 28 '12 at 06:07
-
right click your project, properties-> java build path. check if there is any red mark in any of the files of source , libraries and other tabs. – Sahil Mahajan Mj Dec 28 '12 at 06:09
-
right click-> propertie-.?android-> choose the build target, say android 2.2 – Sahil Mahajan Mj Dec 28 '12 at 06:41
Basically , this error occurs when your project is not being compiled properly. Few quick solutions 1. Clean your project and Build from Project --> Clean and Project --> Build 2. Check Java compiler setting of your project. Make sure you are targeting right JDK. 3. Check the Android Version of the project. (i.e.) Your Android SDK should have required android version to compile and build the apk.
Try the above three. Your problem should get fixed.

- 6,768
- 4
- 24
- 29
-
when i build im getting error in MainActivity.java class and it says "R cannot be resolved as a variable" – sujay Dec 28 '12 at 05:34
-
your layout files are not compiled properly. R.java is not generated. – Brijesh Thakur Dec 28 '12 at 10:27
DO this step:
1.Right click
your project and go for Android tools
and in that select "FIx Project properties"
.
2.Now Clean
the project..I think this will help you..Let try for this and say..

- 5,114
- 10
- 44
- 87