简体   繁体   中英

aapt: Do not skip (null) files when packaging

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM