1

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:

https://pastebin.com/eJvtF1NE

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.

Malkierian
  • 189
  • 1
  • 3
  • 17
  • have you tried `./gradlew --stop` from the command line after disabling the aapt2 in gradle.properties? Google recommends to do it after you have disabled appt2 from gradle.properties – Sagar Mar 30 '18 at 04:24
  • Just tried it now. Got the message about stopping a daemon, went to run the app again, still got the "Failed to execute aapt" error. – Malkierian Mar 30 '18 at 04:39
  • Normally this error happens when your buildToolsVersion is not up to date. What is your buildToolsVersion? and have to tried to Sync Project to gradle file? – Sagar Mar 30 '18 at 04:48
  • 27.0.3 I just barely installed Studio 2 days ago. – Malkierian Mar 30 '18 at 04:53
  • It's a bug in AAPT2. It does not handle files that big yet. – Izabela Orlowska Apr 03 '18 at 11:02

0 Answers0