سؤال

I want to certificate an Android project just with cmd. Now Im stocked at the creation of the .apk file. aapt says he cant find the pictures with the .9. ending. If i rename this pictures and delete the .9. ending then everything works fine without the correct size of the pictures in the app. ettings I figured out that I have to "crunch" this pictures, like what he says at the page: Ant Build AAPT Crunch is stripping draw9 information from Library resource images but Im not sure how this works correctly.

I tried this command:

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

It works with my .9.png files but I still dont get it how I can run it, that it creates the .apk file. How can I use it in the following command ?

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

Just this command gives me the following error:

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

This file is an .9.png file.

With eclipse everything runs fine.

هل كانت مفيدة؟

المحلول

So i figured it out: I have to "crunch" all picture in the res folder first:

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

And then I pointed as a source folder to the res dir and to the bin\res dir. Also added --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 

Now Its working perfectly. Also with the .9.png 9patch pictures.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top