Anyone using the nbandroid plugin for netbeans to develop android apps may have come accross the same problem I did.
R.java doesn't seem to get updated.
In order to fix this, add the following lines to the AnroidManifest.xml and 'build' the project again.
<target name="-pre-compile">
<echo>Generating R.java / Manifest.java from the resources...</echo>
<exec executable="${aapt}" failonerror="true">
<arg value="package" />
<arg value="-m" />
<arg value="-J" />
<arg value="${src.dir}" />
<arg value="-M" />
<arg value="AndroidManifest.xml" />
<arg value="-S" />
<arg value="${resource.dir}" />
<arg value="-I" />
<arg value="${platform.bootcp}"/>
</exec>
</target>
R.java is magically updated
本文解决了使用netbeans开发Android应用时遇到的R.java文件不更新的问题。通过在AndroidManifest.xml中添加特定代码,可以确保每次构建项目时R.java文件得到正确更新。
5152

被折叠的 条评论
为什么被折叠?



