简体   繁体   English

在Android Studio中从APK排除文件夹

[英]Exclude folder from APK in Android Studio

I've included a production folder in the root of my project, after building the APK and opening it as an archive, I've noticed that the production folder has not been included. 我在项目的根目录中包含了一个生产文件夹,在构建APK并将其作为存档打开后,我注意到该生产文件夹尚未包括在内。

Am I right/safe to assume that any un-referenced files/folders are automatically excluded from the APK or should I be using some sort of configuration file to specify an exclusion list? 我是否可以正确/安全地假定所有未引用的文件/文件夹会自动从APK中排除,还是应该使用某种配置文件来指定排除列表?

I would phrase it more as "only stuff in src/ might ever get included in an APK, for a conventional Android Studio project". 我将其更多地表述为“对于常规Android Studio项目,只有src/可能包含在APK中”。

If you create random other directories, those will be ignored, unless you specifically do something in build.gradle to try using them (eg, as an alternative location for assets/ ). 如果您随机创建其他目录,则除非您在build.gradle专门做一些尝试以使用它们(例如,作为assets/的替代位置),否则这些目录将被忽略。

IOW, the contents of an APK come from a whitelist, not a blacklist. IOW,APK的内容来自白名单,而不是黑名单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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