包/路径设置来生成R.java [英] setting package/path to generated R.java

查看:139
本文介绍了包/路径设置来生成R.java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在清单中我有:

...包=com.domain.app.multimedia

然后名称以应用程序/活动:

...活动机器人:名字=多媒体

Eclipse的,反过来,在包/路径下生成R.java:

... com.domain.app <​​/ P>

此软件包/路径名称可能是事先包的重命名的遗产/重构 - 不知道

我presumed(错误,或不)的R.java代会跟随在清单中声明的​​包名。这将是找出如何根选择了它使用路径/包名请客。而更重要的是,什么是清单包名称规则(不是唯一标准precaution等,以及与已拥有的域名)。

否则,我可以用这个(一个简单的解决方案,其中迫使这似乎是一个任意import语句解决这一切尽可能得到一个运行时)居住。

干杯,
理查德


解决方案

一般来说,当你在AndroidManifest.xml文件更改包名称,系统会提示一个问题,如果你想更改配置,以反映新包。
如果你没有点击是的,你可以随时右键单击项目 - > Android的工具 - >重命名应用程序包

In the manifest I have:

... package="com.domain.app.multimedia"

which then names the application/activity with:

... activity android:name=".MultiMedia"

Eclipse, in turn, generates R.java in the package/path:

... com.domain.app

This package/path name may be a legacy of prior package renamings/refactoring - don't know.

I presumed (a mistake, or not) that R.java generation would follow the package name declared in the manifest. It would be a treat to find out how the gen chose the path/package name it uses. And more to the point, what is the rule for the manifest package name (other than the standard precaution of uniqueness, and relating to an owned domain).

Otherwise, I can live with this (an easy solution where forcing what appears to be an arbitrary import statement solves it all as far as getting a runtime).

Cheers, Richard

解决方案

Generally speaking, when you change the package name in your AndroidManifest.xml file, you are prompted with a question if you'd like to change the configuration to reflect the new package. If you haven't clicked yes, you can always right click on the project -> Android Tools -> Rename application package

这篇关于包/路径设置来生成R.java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆