문제

Generating of R file works fine for me. But is there a way to get Eclipse to generate just the R file on demand.

Editing a layout file and re-ordering nextFocus attributes crashes the app, unless you regenerate the R file. So I have to clean the project to generate the R file. But my project is very large, and it feels like a waste of time to rebuild the whole project, just for one file. Is there a way/trick to generate just the R.file?

Note: Build Automatically is checked.

I am working on Library Project, which contains most of the code base for free and paid versions of the app.

도움이 되었습니까?

해결책

Let me reiterate what I understand from your question. Your project is huge and minor changes to a layout result in crashing - owing to rebuilding the entire project. So, you want to know how to build only a part of the project - with the R file instead of rebuilding the entire huge project on minor changes, which crashes.

What you can do is, uncheck the "Build automatically option", make your changes and build manually once all the changes have been made, instead of building the project on every saved change.

I don't think you can generate only the R file since it needs to read all the res files and generate ids for all the resources, excluding none...I don't think that can be done in parts.

There is a way to generate the R.java file from your resources using the Android Asset Packaging Tool (aapt) as stated here (thanks to Pearl for the pointer)

다른 팁

enter image description here

just click on project->buildautomatically to tick

You can't build R.java as per your requirement like it will not build whole project and generate only R.java file.

But let me tell you one thing, R.java file contains resources identifiers. Those identifiers will be generated if and only if project is build. So, you have to build project to stop crashing your project.

You can still unchecked Build Automatically and manually build project by Project -> Build Project option.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top