2014-01-24 39 views
0

我想用cmd證明Android項目。現在庫存在.apk文件的創建。 aapt說他不能用.9找到圖片。結尾。如果我重命名這些圖片並刪除.9。結束然後一切工作正常,沒有正確的大小的應用程序中的圖片。 ettings 我發現我必須「緊縮」這張照片,就像他在頁面上所說:Ant Build AAPT Crunch is stripping draw9 information from Library resource images但我不知道這是如何正確工作的。aapt無法找到9Patch圖像

我試過這個命令:

aapt crunch -v -S res -C bin/res 

它與我的.9.png文件,但我仍然不明白我怎麼可以運行它,它創建的.apk文件。我如何在以下命令中使用它?

aapt package -v -f -A \assets -M \AndroidManifest -S \res -I \android.jar -F \Projectname.unsigned.apk \bin 

就在這個命令給了我以下錯誤:

activity_settings.xml:2: error: Error: No resource found that matches the given name (at 'sound' with value '@drawable/btn_sound_active_pressed') 

此文件是一個.9.png文件。

隨着日食一切運行良好。

回答

0

所以我想通了:我要「緊縮」在res文件夾中的所有圖片第一:

aapt crunch -v -S \res -C \bin\res 

然後我指着作爲源文件夾中的資源目錄和到bin \ RES目錄。還添加了--no-chrunch --generate-dependencies

aapt package --no-crunch --generate-dependencies -v -f 
-M \AndroidManifest.xml" 
-S \bin\res 
-S \res 
-A \assets 
-I \android.jar 
-F \bin\APPNAME.unsigned.apk \bin 

現在它的工作很完美。還有.9.png 9patch的圖片。