android中编译资源文件的相关问题

android中编译资源文件的相关问题:

1. 如何重新编译应用程序的资源文件?

   当修改了资源相关文件(如main.xml)后,需要先编译资源文件,再用mm编译应用程序。为了编译资源文件,需要先将资源删除掉,例如:
   rm ../../../out/target/common/obj/APPS/SoundRecorder_intermediates -rf
   mm
   
   分析:Android中,编译过的应用程序的资源放在如下的目录下:
   out/target/common/obj/APPS/应用程序名_intermediates。

2. 不小心将out/target/common/obj/APPS目录删除了,怎么办?
   这时,需要先编译出out/target/common/obj/APPS/framework-res_intermediates,再编译应用程序的资源文件即可,具体如下:
   进入到frameworks/base/core/res目录下,执行mm,如下:
   cd frameworks/base/core/res
   mm
   分析:1. 编译应用程序的资源文件需要有framework-res_intermediates,才可以,否则,会报错。

        2. framework-res_intermediates是framework的资源文件目录,也位于out/target/common/obj/APPS/目录下。


我将layout文件夹下的main.xml文件重命名后,编译出错:

packages/apps/SoundRecorder/src/com/android/soundrecorder/SoundRecorder.java:498: cannot find symbol
symbol  : variable main_zwq
location: class com.android.soundrecorder.R.layout
        setContentView(R.layout.main_zwq);
                               ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: packages/apps/SoundRecorder/src/com/android/soundrecorder/RecordingFileList.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
63 warnings

make[1]: *** [out/target/common/obj/APPS/SoundRecorder_intermediates/classes-full-debug.jar] Error 41
make[1]: Leaving directory `/home/zwq/sc170120130124/sc1701/mt6577_icsv109'
                         out/target/product/qishang77_cu_ics2_mm.log_err
                    ==> [FAIL]  2013/01/25 10:43:53
make: *** [mm] Error 1
root@sean-codeserver:/home/zwq/sc170120130124/sc1701/mt6577_icsv109# rm -fr out/target/common/obj/APPS/SoundRecorder_intermediates
root@sean-codeserver:/home/zwq/sc170120130124/sc1701/mt6577_icsv109# ./mk qishang77_cu_ics2 mm packages/apps/SoundRecorder

你可能感兴趣的:(android中编译资源文件的相关问题)