You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用App Bundle时能否为raw文件夹生成差异化配置APK?

Answer

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:

  1. Organize your MP3 files by language
    Instead of putting all your localized MP3s directly in res/raw/, create language-specific raw directories. For example:

    • res/raw-es/ for Spanish audio files
    • res/raw-fr/ for French audio files
    • res/raw-zh-rCN/ for Simplified Chinese audio files
      Keep the filenames identical across all directories (e.g., welcome.mp3 in each language folder) so your code can reference them uniformly with R.raw.welcome.
  2. 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/raw files 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 06:50:35