tags:

views:

16

answers:

1

The scene: I have a directory structure like the following:

mkdir -p foo/bar  
touch foo/bar/test.txt

What I want to do is to add test.txt to a .apk under the directory foo/bar, so that uncompressing or listing the apk returns the same directory structure.

This worked fine under the 1.6 SDK:

aapt add test.apk foo/bar/test.txt

I could list and uncompress test.apk and all was well. Under 2.1, however, test.txt is added to the root of test.apk, which isn't what I want.

I just tested this under the 2.1 SDK on my desktop and the older 1.6 version on my laptop, and I've confirmed that it used to work and now doesn't.

I've looked at the aapt command line options, and if there's a --keep-the-files-i-add-in-their-subdirectories option then I'm just not seeing it. :/ Googling is also not returning anything useful.

Would really appreciate help with this. I need to store third-party .properties files in my Android application so they're on the classpath, and my inability to find the right command line incantations is the only blocker keeping this app off of 2.1. :)

Thanks a bunch.

A: 

It seems there might be different behavior in Win vs. Ubuntu (all Linux?). I can confirm what Nolan says in the original post under my Ubuntu-karmic machine. The dir structure gets added just fine under Windows, all using Android-8. Does anyone know why or how to get around this?

sofarrar