I added the Android Studio tag because, though I'm using Android Studio, I wasn't sure if this was an Android problem or a Studio problem...
So I have this particular app that I want to make that will require having a specific audio file that will end up being around 1.5 hours long. Naturally, this means that the file's size will be very large. The file I wanted to use (256kbps) was around 170MB. WAAAAY too big for Android, apparently. I did some testing, and while a file with the size of 65860KB is too big, one with the size of 65515KB is acceptable. I can also do multiple files of 65515 or smaller with no issues.
Now, the problem that I'm getting, when I try to use a file bigger than 65515 KB, I get some ambiguous AAPT2 error message in the console:
Error text, no code
And when I click on Toggle View to have a look at the gradle output, I see
{pathToSource}\app\build\intermediates\res\merged\debug\raw_ee7.mp3.flat: error: failed to read data meta data.
I honestly don't know what that means, but it seems like it's at least related to the fact that it's a big file. I've tried the android.enableAapt2=false
option in gradle.properties
, but while a Clean Build
operation succeeds, I get a warning saying it's deprecated and shouldn't be used anymore, and when I try to run or debug, I get an error message saying
Error while generating dependencies split APK
com.android.ide.common.process.ProcessException: Failed to execute aapt
I got the idea to try the aapt2 disabling from this other question here on SO:
https://stackoverflow.com/questions/46961577/android-studio-error-failed-to-read-metadata-after-update-to-3-0-0
But id doesn't work anymore, and it looks like Google haven't fixed it in their end yet.
So is there anything I can do until they fix it themselves, other than changing IDEs? I could, because I just barely started developing this app. I can't feasibly cut that file into smaller pieces, because playback will require a degree of precision I can't get with handling multiple instances of MediaPlayer
.