3

I tryed to create new project and in my R.java there was next code, for example:

public static final class layout {
public static int activity_main=0x7f030000;

instead of

public static final class layout {
public static final int activity_main=0x7f030000;

So I can't build project normally, because it generates public static int without final.

What should I do?

4
  • R.java is generated by your compiler. If your src files are correct & your res/*.xml files are correct, then R.java will also be correct Commented Oct 7, 2012 at 14:05
  • but it isn't corrent ( I have clear windows, where I installed need programms only (Eclipse, Android ADT, etc.) Commented Oct 7, 2012 at 14:52
  • I dont understand. Make sure you have no errors in your res/*.xml. Make sure that all the elements in your xml files that have a "@" are resolved. Also check your xml files for lines like : android:layout_marginTop="?android:attr/actionBarSize". Make sure its resolved. Commented Oct 7, 2012 at 15:32
  • Then you need to follow instructions in the given answer Commented Oct 7, 2012 at 15:34

2 Answers 2

1

Right Click on project --> Android Tools -->fix project properties

before doing this remove import statement like

import android.R.*..

or try clean project from

project --> clean

Sign up to request clarification or add additional context in comments.

4 Comments

right click on porject Buildpath --> configure buildpath --> remove all android library then try Right Click on project --> Android Tools -->fix project properties it will work
Error: case expressions must be constant expressions ActivityMain.java
No, becase it has commentary :/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */
It seems that your error has nothing to do with your original question
0

This could be because of many things. 1. Check your xml files have no errors in them as this can stop R.Java from being automatically generated. 2. Clean your project. This will rebuild your project. 3. Delete any android.R import statements. 4. Close and re-open eclipse.

I also wouldn't recommended fiddling with the R.Java file dirctley.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.