开发者

R.* error in Notepadv3

开发者 https://www.devze.com 2023-02-13 02:04 出处:网络
I just imported the Android tutorial solution Notepadv3.I wanted to see it run. As usual, I\'m greeted with the inability to resolve R.

I just imported the Android tutorial solution Notepadv3. I wanted to see it run.

As usual, I'm greeted with the inability to resolve R.

I searched for an import R line and see none.

I edited a line and saved. I closed and opened the application.

What do I do??

This seems to happen on every project.

(I have tried this with Eclipse Ganymede under Ubuntu 9.开发者_C百科1 and Eclipse Helios under Windows 7.)


I searched for an import R line and see none.

R.java will be generated in the same package that is declared in the manifest. Usually, your code resides in that same package, and therefore a manual import of R is not needed.

What do I do??

R.java will be created as part of the build process, in your project's gen/ directory.

If you have automatic builds enabled, and R.java is not being built, check your Eclipse console for error messages, such as bad or missing resources.

If you do not have automatic builds enabled, do a build.

Every now and then, you will need to do a Project|Clean to clear out erroneous errors and force Eclipse and Android to rebuild your project from scratch.


In addition to what @CommonsWare said, if after you do a Project > Clean and R is still not resolved, make sure you are importing your project's R.java and not android.R.*.


check for errors in .xml files.Build may be failing because of these.

0

精彩评论

暂无评论...
验证码 换一张
取 消