Android Resource and the Eclipse switch Quick Fix

In the process of updating and refactoring an old Android project I unwittingly changed a Project configuration option (the “Is Library” option) that lead to my resource file being generated differently. E.g

Before

public final class R {
    public static final class id {
        public static final int button1=0x7f090001;
        public static final int button2=0x7f090002;
        public static final int button3=0x7f090003;
    }
}

After

public final class R {
    public static final class id {
        public static int button1=0x7f090001;
        public static int button2=0x7f090002;
        public static int button3=0x7f090003;
    }
}

A subtle change indeed but one that caused the following compiler error for each line

case expressions must be constant expressions

Continue reading