I am developing an Android application that uses a number of python scripts in res/raw
that are deployed via SL4A and included in the app's APK. As the scripts make use of python packages, their directories contain a number of 0byte sized __init__.py
files that are necessary for python to recognize the directories as packages.
My problem is that aapt
skips those files during packaging, thus preventing the scripts from working on the device/emulator, as the modules are not found by the interpreter:
[aapt] Creating full resource package...
[null] (skipping (null) file '/home/user/app/res/raw/pypackage/__init__.py')
Is there a way to tell aapt
to include the files nevertheless, or do I have to pad the files manually to make them >0kb sized? I already looked at the aapt
command-line options but I didn't find anything.
If this is your only problem you can just add a comment '#' inside the
__init__.py
files. If you find more problems as the directory structure you can use a tar or zip and expand it after APK installation.