Not enough storage space to install required resources.

So here is the story. Our builds are done on Jenkins via a custom script. 99% of cases, we have our builds successful running on devices. However sometimes (no particular reason :)), we are getting errors as mentioned in the title. And of course, WE DO have enough space to install .apk :slight_smile: Now, what is funny about this is that even if we got this error, some devices are running the same .apk without a problem :smile: I run logcat to try to figure out what might be the problem and the only thing that I noticed, is when the error occurs, we also see this error in the logs:

2021-02-24 12:46:46.880 16669-17835/com.potatoplay.MergeManor D/Unity: il2cpp failed to extract resources (assets/bin/Data/Managed => /storage/emulated/0/Android/data/com.potatoplay.MergeManor/files/il2cpp)

Unity 2019.4.17f1 - my workspace
Unity 2019.4.15f1 - Jenkins
Any thoughts/help? :slight_smile:

6871727–802031–Success.txt (39.8 KB)
6871727–802034–Error.txt (35.8 KB)

The error is a bit misleading, what really happens in this case, Unity fails to extract files into /storage/emulated/0/Android/data/com.potatoplay.MergeManor/files/il2cpp, the most common case is not enough space. But there are probably other reasons as well.

You say in 99% it’s fine, but 1% is not fine, is that 1% happens only on one specific device, or it can happen on any device?

As for devices, this is a good question. Don’t have any specifics. One build did not work on OnePlus Nord but worked on motorola g7 power. Furthermore, when I hit “build again” with the same build configuration, NOTHING changed, the build works perfectly on all devices. If needed can provide build logs.

If possible try running the build on failing device, and see if it happens consistently

Yes it does.

Try using adb or Android Studio’s device explorer and see if you can reach /storage/emulated/0/Android/data/ folder, or even /storage/emulated/0/Android/data/com.potatoplay.MergeManor/ .

Additionally check if device really has enough storage memory.

Got two empty folders “cache” and “files” inside of /storage/self/primary/Android/data/com.potatoplay.MergeManor/

I know that it is not the same folder, but don’t have permission to enter emulated/0

I am not sure I understand, when you manually install on that specific device, then the app runs fine, but when installing in automated way you get “Not enough storage space to install required resources.”

Sorry :slight_smile: What I wanted to say is just that, I don’t have any files in those specific folders :slight_smile:

Hard to say what’s wrong, if you can please submit a bug a with apk attached, specify which phones and what Android version they have, which show this behavior. Maybe our QA can reproduce

We just solved a “not enough storage space to install required resources” by whitelisting “unityLibrary/src/main/assets/bin” folder (that default android studio .gitignore ignored). We were building on a Jenkins server and that folder was not being pushed from the machine we used to export the Unity project to the server.

2 Likes

@krzyszpieta Hi, did you find any workthrough for the issue?

@Tomas1856 I can reproduce this issue on 90 % of the app starts when the Split Application Binary and Build App Bundle options are turned on (when the new Play Asset Delivery feature used) and the Compression method set to LZ4. If I change it to Default the problem goes away. Bug report id: 1372558

Thank you, this was my problem as well!

I’m running into the same problem on Samsung S22 when downloading the game from Google Play. It started happening out of the blue, it actually worked on the same device a few weeks back, and I haven’t changed the APK in Google Play. Here is my problem in more details- android - Not enough storage space to install required resources - AssetModuleException - Stack Overflow

Is there a way to disable buggy storage check by Unity? I want to implement my own storage check

I deleted my library folder within my Unity project and and then reopened Unity and this solved. I think it has something to do with a corrupted build.