excludeFiles not working on Android?

I am porting an iOS app to Android and have noticed that when building for Android, two folders that I am excluding from my builds in build.settings (“excludeFromBuild” and “workFiles”) are still being included. This doesn’t happen when I build for iOS, and I tried moving my exclusion terms from the “all” table to the “android” table, but with the same result. I’m tempted to call this a bug, but I didn’t see anybody else mention it on the Forums, which makes me wonder if I’m just missing something here. Any ideas, fellas & ladies? I’m working with daily build 2014.2399. 

Here’s my excludeFiles table in my build.settings, which works as you’d expect when building for iOS, but not for Android (I’ve tested building for Google Play as well as Amazon):

excludeFiles = { all = { "excludeFromBuild/\*", "workFiles/\*" }, iphone = {}, android = {}, },

Just a thought.  Since it works on iOS but not Android, perhaps you have an error in your build.settings that might be impacting the android loading perhaps in the main android table.  Try  moving the excludeFiles above the android table and see if it changes anything.

Rob

Thanks for the reply, Rob. That is an excellent idea, but unfortunately it didn’t fix things. Even with the excludeFiles table above my android table, the issue persists. My iOS .app file is around 60MB, whereas the Android APK of the same app comes to over 700MB…yikes! To make matters even stranger, if I watch the console output during build, the very first thing that prints out is:

Excluding specified files from build: excluding: excludeFromBuild/\* excluding: workFiles/\*

Why would my console lie to me? I’ve always been so nice to it. :slight_smile:

Let me know if you think this warrants a bug report. I’m just surprised that others haven’t discovered it yet. Perhaps it crept into a very recent daily?

I just conducted a quick test.  My folder ~/tmp has 362MB of files in it as seen by this “du” command:

robs-MacBook-Pro:AppBuilds rmiracle$ du -sh ~/tmp
362M    /Users/rmiracle/tmp

with this code in my build.settings:

    excludeFiles =     {       all = { "myJunk/\*" },     },

I did an iOS build and an Android build and this is the results:

-rw-r–r--   1 rmiracle  staff   5605401 Aug 15 19:29 tmp.zip
-rw-r–r--   1 rmiracle  staff  10424844 Aug 15 19:30 tmp.apk

The iOS app’s .zip file is 5.6MB.  The Android file is 10.4MB.  Neither of these are any where near 362mb.  I’m reaching for straws here, but perhaps you should try to remove the two empty iOS and Android specific arrays and try it. 

BTW: You should get 2401.  There was an iOS build issue still present in 2399.

Rob

Hi Rob,

Thanks for the follow-up. I downloaded 2401, removed the extra tables from my excludeFiles table (leaving only the “all” table), and build to pretty much the same situation: a 60-something MB .app and a 800MB .apk. Sigh. Well, if this isn’t affecting you, and it apparently isn’t affecting anybody else, I’m just going to leave it be and manually remove those folders when building this app. I probably have some weirdly-formatted files in those folders that are screwing things up. When I have the time, I’ll try a test case using different folders (with nothing but JPEGs for example) to exclude and see if the issue is replicated under those conditions. If I discover anything useful, I’ll post a reply on this thread.

Oh, well. Thanks for helping!

I don’t see any pattern problems in your settings.  I think your idea about trying some additional folder names and see what’s going on.  Also the .apk is just a zip file, you can can unzip it and look through it and verify if your files are there that shouldn’t be are or are not.  Perhaps something else is being included.

Rob

Jason, I PMed you with some requests for more information so we can get to the bottom of this.

I’m running into problem too. It seems if I exclude like this:

all = {“img/originalFiles/*”},

All the FILES in img/originalFiles/ are excluded but not folders. For example img/originalFiles/someFolder will not be excluded and all files in there as well. Is this expected behavior?

I would think that img/origninalFiles/* would get everything in that folder, but I could see where it wouldn’t include the folder itself.  But I would think it should get sub folders.

Have you tried:  “img/originalFiles”

and see what happens?

Rob

Thanks Rob.

Yes I tried that and then nothing got excluded which was a bit surprising. I was doing this on Android, have not tried on iOS.

It’s late here, can test more tomorrow if needed.

Just a tip. If you want to exclude all ‘@4x.png’ files in your asset folder, and your asset folder has a lot of sub-folders (see sample below), use this to exclude them.

The asset  folder has a lot of sub-folders :

asset/image1Folder asset/image2Folder

excludeFiles = { android = { "asset/\*/\*@4x.png" } }

Just a thought.  Since it works on iOS but not Android, perhaps you have an error in your build.settings that might be impacting the android loading perhaps in the main android table.  Try  moving the excludeFiles above the android table and see if it changes anything.

Rob

Thanks for the reply, Rob. That is an excellent idea, but unfortunately it didn’t fix things. Even with the excludeFiles table above my android table, the issue persists. My iOS .app file is around 60MB, whereas the Android APK of the same app comes to over 700MB…yikes! To make matters even stranger, if I watch the console output during build, the very first thing that prints out is:

Excluding specified files from build: excluding: excludeFromBuild/\* excluding: workFiles/\*

Why would my console lie to me? I’ve always been so nice to it. :slight_smile:

Let me know if you think this warrants a bug report. I’m just surprised that others haven’t discovered it yet. Perhaps it crept into a very recent daily?

I just conducted a quick test.  My folder ~/tmp has 362MB of files in it as seen by this “du” command:

robs-MacBook-Pro:AppBuilds rmiracle$ du -sh ~/tmp
362M    /Users/rmiracle/tmp

with this code in my build.settings:

    excludeFiles =     {       all = { "myJunk/\*" },     },

I did an iOS build and an Android build and this is the results:

-rw-r–r--   1 rmiracle  staff   5605401 Aug 15 19:29 tmp.zip
-rw-r–r--   1 rmiracle  staff  10424844 Aug 15 19:30 tmp.apk

The iOS app’s .zip file is 5.6MB.  The Android file is 10.4MB.  Neither of these are any where near 362mb.  I’m reaching for straws here, but perhaps you should try to remove the two empty iOS and Android specific arrays and try it. 

BTW: You should get 2401.  There was an iOS build issue still present in 2399.

Rob

Hi Rob,

Thanks for the follow-up. I downloaded 2401, removed the extra tables from my excludeFiles table (leaving only the “all” table), and build to pretty much the same situation: a 60-something MB .app and a 800MB .apk. Sigh. Well, if this isn’t affecting you, and it apparently isn’t affecting anybody else, I’m just going to leave it be and manually remove those folders when building this app. I probably have some weirdly-formatted files in those folders that are screwing things up. When I have the time, I’ll try a test case using different folders (with nothing but JPEGs for example) to exclude and see if the issue is replicated under those conditions. If I discover anything useful, I’ll post a reply on this thread.

Oh, well. Thanks for helping!

I don’t see any pattern problems in your settings.  I think your idea about trying some additional folder names and see what’s going on.  Also the .apk is just a zip file, you can can unzip it and look through it and verify if your files are there that shouldn’t be are or are not.  Perhaps something else is being included.

Rob

Jason, I PMed you with some requests for more information so we can get to the bottom of this.

I’m running into problem too. It seems if I exclude like this:

all = {“img/originalFiles/*”},

All the FILES in img/originalFiles/ are excluded but not folders. For example img/originalFiles/someFolder will not be excluded and all files in there as well. Is this expected behavior?

I would think that img/origninalFiles/* would get everything in that folder, but I could see where it wouldn’t include the folder itself.  But I would think it should get sub folders.

Have you tried:  “img/originalFiles”

and see what happens?

Rob

Thanks Rob.

Yes I tried that and then nothing got excluded which was a bit surprising. I was doing this on Android, have not tried on iOS.

It’s late here, can test more tomorrow if needed.