IntelliJ IDEA 10.5 添加图像时 R.java 出错!

发布于 2024-11-16 16:43:59 字数 856 浏览 8 评论 0原文

我在 IntelliJ IDEA 10.5(IC 版)中创建一个新的 Android 项目,注册 Android 库,一切顺利。然后我将 /drawable 目录添加到 /res 目录并在其中放置图像。如果我想编译,就会出现错误。

当我导航到 R.java 中的这些行时,我只看到一个简单的自动生成的初始化。

public final class R {
    public static final class attr {
    }
    public static final class drawable {
        public static final int img1=0x7f020002;
        public static final int img2=0x7f020003;
        public static final int icon=0x7f020004;
        public static final int img3=0x7f020005;
    }
    public static final class layout {
        public static final int main=0x7f030000;
        public static final int other=0x7f030001;
    }
    public static final class string {
        public static final int app_name=0x7f040000;
    }
}

有谁知道这个问题是什么?我正处于项目的开始阶段,我想我会回到10.0.3版本。

I create a new Android project in IntelliJ IDEA 10.5 (IC edition), register Android library and all goes fine. Then I add /drawable directory to /res directory and place an image inside of it. If I want to compile, I get an error.

When I navigate to these lines in R.java, I see just a simple auto-generated initializations.

public final class R {
    public static final class attr {
    }
    public static final class drawable {
        public static final int img1=0x7f020002;
        public static final int img2=0x7f020003;
        public static final int icon=0x7f020004;
        public static final int img3=0x7f020005;
    }
    public static final class layout {
        public static final int main=0x7f030000;
        public static final int other=0x7f030001;
    }
    public static final class string {
        public static final int app_name=0x7f040000;
    }
}

Anyone knows that this problem is? I am in the beginning of the project and I think I will return to 10.0.3 version.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫罗兰の梦幻 2024-11-23 16:43:59

这不是android的限制,而是java变量名称的限制。它不能以数字开头。

It is not the android limitation but java variable name one. It can not start with a number.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文