我在Android Studio 1.3.1中照常打开我的项目,添加修改并开始构建,出现错误:
Error:(1630, 32) error: expected
Error:(1630, 38) error: illegal start of type
Error:(1630, 39) error: expected
向我展示:
public static final class drawable {
public static final int 31205=0x7f020000;
public static final int abc_ab_share_pack_mtrl_alpha=0x7f020001;
public static final int abc_btn_check_material=0x7f020002;
public static final int abc_btn_check_to_on_mtrl_000=0x7f020003;
public static final int abc_btn_check_to_on_mtrl_015=0x7f020004;
[...]
我恢复了更改,但错误仍然发生。
我不知道出了什么问题,因为我之前使用了恢复的代码,没有任何问题。
最佳答案
Java 变量名不能以数字开头,如下所示:
public static final int 31205=0x7f020000;
也许您使用名称以数字开头的可绘制资源。
关于java - R.java 构建时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32102750/