使用App Bundle时能否为raw文件夹生成差异化配置APK?
Great question! Let’s walk through how to handle your localized MP3 files in the App Bundle, plus address your follow-up about future plans.
How to Split Localized res/raw MP3s into Configuration APKs
The key here is to leverage the existing language split functionality you already have enabled—you just need to structure your resources correctly. Here’s what to do:
Organize your MP3 files by language
Instead of putting all your localized MP3s directly inres/raw/, create language-specific raw directories. For example:res/raw-es/for Spanish audio filesres/raw-fr/for French audio filesres/raw-zh-rCN/for Simplified Chinese audio files
Keep the filenames identical across all directories (e.g.,welcome.mp3in each language folder) so your code can reference them uniformly withR.raw.welcome.
Ensure language splits are enabled
You already have this in your build.gradle, but just to confirm:android { bundle { language { enableSplit = true } density { enableSplit = true } abi { enableSplit = true } } }With this setup, Google Play will automatically generate separate configuration APKs for each language, containing only the
res/rawfiles that match that language. Users will only download the APK(s) corresponding to their device’s language, drastically reducing the installed size.
About Additional Split Attributes & Future Plans
As you noted, the official App Bundle documentation currently only lists abi, density, and language as supported split dimensions. There’s no public, concrete timeline for adding new split types (like a dedicated split for raw resources) from Google at this moment.
That said, the language split workaround above should fully address your need to reduce APK size by only delivering relevant localized audio files to users. If you’re looking for updates on new App Bundle features, keep an eye on Android Studio’s release notes and the official Google Play Developer documentation—any new split capabilities will be announced there first.
内容的提问来源于stack exchange,提问作者Abhinandan Mittal

