Corona file number limit in Android?

Last friday we sent a new update to both iOS and Android on one of our apps, but we noticed that the Android beta build crashed immediately. iOS was Okay and it is already ready for sale. So we started digging, and tried everything. Disabling plugins, changing configurations, etc. Nothing worked.

We then removed random files (minigames in this case) and the game started with no problem. We then re-added these files and we were back to the same point, crashing app on startup. We removed other random files (This time we removed some characters) and the game worked. So our conclusion is that we hit a limit on the number of files that Corona somehow supports for Android.

So we checked how many files we have right now, and we have 35169 files and 2762 folders. We also checked the Android output and there was a message that said “This application failed to load and execute main.lua”

Has anyone had a similar experience? I know the zip limit is around 65000 files but we are not close to that right now. Maybe a Corona Dev knows what is causing this limitation?

What version of Corona SDK are you using?

How big is your APK file?

There is a 40mb limit before you have to start using expansion files if my Googling was accurate.

Rob

We tried using 2992, and now 3032. None work. Using both macOS and Windows.

Our APK for the store  does have expansion files. The APK is around 25 Mb and the expansion file is around 340 Mb. The current version is working fine, and you can check it out live, here in this link.

The expansion file requirement is only for uploaded builds, both for alpha, beta, and production builds, but you can test out the app without expansion files, by installing directly on the device. I know it since i have done it countless times. 

We have uploaded the APK and OBB file to the google play developer console to test it out in beta, which is much like iOS testflight, and it just crashes, we don’t even see our splash screen.

EDIT: Anyway, i just replicated the bug, with a 7 Mb project. Submitted a bug request. If you wish to try it out, here is the download link for the project. It’s basically the HelloWorld with an extra 40,000 empty text files. Build it on any version of Corona SDK and install on your device. I can guarantee you it’s gonna crash. Build for iOS and it won’t.

Can you submit the bug again and email it to support@coronalabs.com.

There is a good chance this is an Android limit.

Thanks

Rob

Nothing springs to mind that would impose a limit on the number of files in a project though the upper number is more usually 1000s of files, not 10s of thousands.  I’d guess you’ve hit an APK limit on some version of Android (you don’t mention what versions you’ve tried).

I have to assume that in a project with 35169 files many of them are machine generated or there are many duplicates.  The quickest solution to your issue is going to be to change your generation process to produce fewer, larger files or fewer duplicate files.

We tried it on Android 7.0, 6.0.1, and 4.4.2. All of them crash.

Our live, working version, works on all of these systems with no problem. This live, working version has around 34,000 files.

The only information logcat tells me when i filter Corona logs is this:

This application failed to load and execute main.lua

And no, there is only 1 machine generated file. The rest are assets, which include png, mp3, and json files. Download the game and you will see it. I can even send you the APK for you to examine it.

We have around 300 unique minigames, more than 100 unique characters (For the battle part, excluding the ones in minigames) Around 16 stages, and many more stuff. We do share sounds and particles across characters and other stuff. This is a subscription based game and it will continue to grow.

For now we will be packing textures which should save some considerable amount of files. I will also do the same test on a normal, non-Corona APK to see if this is specific to Corona SDK or Android.

After making a blank HelloWorld with the latest Android Studio with both target and minimum sdk API level 16, with the same 40,000 files that the Corona build one has, the non-Corona APK launches normally and without issues. Tested with the 6.0.1 and 4.4.2 device.

Decompiled and the 40K files are there.

Sent the bug report with detailed information.

This should be fixed in Daily Build CoronaSDK 2017.3040.  The limit is now 65535 files.

What version of Corona SDK are you using?

How big is your APK file?

There is a 40mb limit before you have to start using expansion files if my Googling was accurate.

Rob

We tried using 2992, and now 3032. None work. Using both macOS and Windows.

Our APK for the store  does have expansion files. The APK is around 25 Mb and the expansion file is around 340 Mb. The current version is working fine, and you can check it out live, here in this link.

The expansion file requirement is only for uploaded builds, both for alpha, beta, and production builds, but you can test out the app without expansion files, by installing directly on the device. I know it since i have done it countless times. 

We have uploaded the APK and OBB file to the google play developer console to test it out in beta, which is much like iOS testflight, and it just crashes, we don’t even see our splash screen.

EDIT: Anyway, i just replicated the bug, with a 7 Mb project. Submitted a bug request. If you wish to try it out, here is the download link for the project. It’s basically the HelloWorld with an extra 40,000 empty text files. Build it on any version of Corona SDK and install on your device. I can guarantee you it’s gonna crash. Build for iOS and it won’t.

Can you submit the bug again and email it to support@coronalabs.com.

There is a good chance this is an Android limit.

Thanks

Rob

Nothing springs to mind that would impose a limit on the number of files in a project though the upper number is more usually 1000s of files, not 10s of thousands.  I’d guess you’ve hit an APK limit on some version of Android (you don’t mention what versions you’ve tried).

I have to assume that in a project with 35169 files many of them are machine generated or there are many duplicates.  The quickest solution to your issue is going to be to change your generation process to produce fewer, larger files or fewer duplicate files.

We tried it on Android 7.0, 6.0.1, and 4.4.2. All of them crash.

Our live, working version, works on all of these systems with no problem. This live, working version has around 34,000 files.

The only information logcat tells me when i filter Corona logs is this:

This application failed to load and execute main.lua

And no, there is only 1 machine generated file. The rest are assets, which include png, mp3, and json files. Download the game and you will see it. I can even send you the APK for you to examine it.

We have around 300 unique minigames, more than 100 unique characters (For the battle part, excluding the ones in minigames) Around 16 stages, and many more stuff. We do share sounds and particles across characters and other stuff. This is a subscription based game and it will continue to grow.

For now we will be packing textures which should save some considerable amount of files. I will also do the same test on a normal, non-Corona APK to see if this is specific to Corona SDK or Android.

After making a blank HelloWorld with the latest Android Studio with both target and minimum sdk API level 16, with the same 40,000 files that the Corona build one has, the non-Corona APK launches normally and without issues. Tested with the 6.0.1 and 4.4.2 device.

Decompiled and the 40K files are there.

Sent the bug report with detailed information.

This should be fixed in Daily Build CoronaSDK 2017.3040.  The limit is now 65535 files.