0

I have developed an Android application with a feature that allows you to change the entire App locale language. It works perfectly in Debug mode. Unfortunately after the release in the Play Store this feature no longer works.

I have already seen these questions, where they say that it would be enough to edit the build.gradle file.

Android App Locale Not Working on Play Store Release

Android App Bundle with in-app locale change

android {
    //...
    //... removed for brevity
    bundle {
        language {
            enableSplit = false
        }
    }
}

Unfortunately I developed it in Xamarin.Android and not in Android Studio and so I have no idea how I could modify that file and achieve the same result. I also do not want to support download on demand.

Could anyone help me please? Thanks in advance

EstevaoLuis
  • 2,422
  • 7
  • 33
  • 40

1 Answers1

1

I finally managed to found a solution and fix my issue.

First, I have added this file BundleConfig.json to my project.

{
  "optimizations": {
    "splitsConfig": {
      "splitDimension": [{
        "value": "LANGUAGE",
        "negate": true
      }]
    }
  }
}

Second, I edited my project's csproj file, adding a AndroidBundleConfigurationFile item under the release PropertyGroup.

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    ...
    <AndroidBundleConfigurationFile>BundleConfig.json</AndroidBundleConfigurationFile>
  </PropertyGroup>

Then, I saved the solution, recreated my aab bundle, and locales were being changed correctly on release mode.

Sources:

https://learn.microsoft.com/en-us/xamarin/android/release-notes/10/10.3#support-for-android-app-bundle-configuration-files

https://developer.android.com/studio/build/building-cmdline#bundleconfig

EstevaoLuis
  • 2,422
  • 7
  • 33
  • 40