简体   繁体   中英

Exclude /assets folder from building/exporting it to APK

I use expansion files in my project, and I have placed all my assets into expansion file. So I access the assets from expansion file. Now that all my assets are in expansion file. I don't want to build them while building android application, but I don't want also to remove them from project path as they are source controlled with SVN. I tried to use eclipse->exclude form build which has no effect. So can any one suggest is there way in Eclipse to exclude asset folder?

Why don't you rename assets folder? Maybe tomorrow you'll want to use the assets folder. You better not touch special android folders and create your own.

Usually I create _assets and _drawable folders. Such folders (starting with underscore) are not processed by android build.

If you're using Gradle build you can use android.aaptOptions to configure this:

android {
    aaptOptions {
        def defaultIgnorePattern = '!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~'
        ignoreAssetsPattern defaultIgnorePattern + ':descript.ion:!*.yuml'
    }
}

I use it to not package descript.ion files in general and yuml diagrams which I keep in src/main/assets next to my DB scripts.

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